+ Reply to Thread
Results 1 to 14 of 14

List box population that does not seem to happen

  1. #1
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    List box population that does not seem to happen

    I am writing some code to have a date pre selected in a set of 3 list boxes and then when the ok button is pressed this date will be added to the excel spreadsheet instead of the date that was originally in the cell. The problem that occurs is that one of the list boxes seems to poulate with the correct number of entries but they are all blank when checking them with msgbox value.

    Below is the user form initialize and select button subs

    Please Login or Register  to view this content.
    I have tried a number of ways of getting the data into the list boxes - thus the number of comments. It also doesn't make sense that the problem with the values started with the year(listbox7) and then has moved to the month(listbox6) and the day(listbox5) on occasions Also the other date information (listbox 2,3 and 4) are fine

    Thanks for your help in advance

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: List box population that does not seem to happen

    pretty hard to tell from that code alone, especially when some of the variables used are not defined.
    for example in these line only V is defined, and that's a local variable.

    Please Login or Register  to view this content.
    Can you post example file?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: List box population that does not seem to happen

    May you post a workbook sample?

    Are the listboxes multi-select? Are the listboxes that do not work different from the the listboxes - it seems they may sit in a Frame control?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: List box population that does not seem to happen

    Just a quick one.. not the answer to your question.. but..

    Change this:
    Please Login or Register  to view this content.
    to this:
    Please Login or Register  to view this content.
    Last edited by apo; 01-24-2014 at 05:37 AM.

  5. #5
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    I seem to be having a problem adding the attachment - here is a link to a google drive file

    https://drive.google.com/file/d/0B9P...it?usp=sharing

    Hope that works

    The problem I am having is is user form 2 list boxes 5,6,7
    Attached Files Attached Files
    Last edited by TimRussell; 01-24-2014 at 05:56 AM. Reason: And this time without the protection on the vba

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: List box population that does not seem to happen

    how do we use it?

    I tried running update_audit macro but it fails on overflow variable. (I corrected the error of incorrect workbook name)

  7. #7
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    Each of the 4 buttons will perform a task within the spreadsheet - the one that is proving a problem for me is the update audit - just checked and found that without any data it has an issue - will fix and resend out

  8. #8
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    So take 3

    Link for the g drive
    https://drive.google.com/file/d/0B9P...it?usp=sharing
    and attachment
    Attached Files Attached Files

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: List box population that does not seem to happen

    Sorry I must be being think but what is not working? What do we need to do in order to see the actual problem.

    If I select a date from Listbox1 and press Select, items in listbox5/6/7 get selected.

  10. #10
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    What i am trying to do is when I select a audit from list box 1 the day of audit is automatically selected in list boxes 5,6,7 This looks like it is happening with the items selected, the plan is to use the out put of these 3 to repopulate the date of audit cells. However when I try to get this auto selection 1 of the lists does not select and after investigation I had discovered that it would not display the values in a list using the following

    Please Login or Register  to view this content.
    Which seemed to be the root of my problems - as I was trying to select the item using .listindex or .selected and that produced a "" result

  11. #11
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: List box population that does not seem to happen

    Perhaps you may use .List(.Listindex) rather than .Value?

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: List box population that does not seem to happen

    When you use the .Selected() array to set the highlighted item you can not use the Value property, even though the Multiselect is set to single.

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    Andy / Izandol
    So then I would need to use the listindex and array's to provide the values I need to populate the adate (in the ok button procedure) - I'll give that a go and see what happens - thanks for your input

  14. #14
    Registered User
    Join Date
    01-24-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: List box population that does not seem to happen

    So I have just tried and using the following code - works

    Please Login or Register  to view this content.
    Thanks again for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Transpose a list after population
    By C90RanMan in forum Excel General
    Replies: 3
    Last Post: 10-29-2010, 02:59 PM
  2. Conditional population of a list - possible or not...
    By s80NL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2009, 06:04 AM
  3. UserForm list population
    By RobbMiller in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2007, 11:01 PM
  4. I can't make what I want to happen, happen.
    By Thanos in forum Excel General
    Replies: 6
    Last Post: 01-16-2007, 01:29 PM
  5. population list box without repeating information
    By medicenpringles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2005, 11:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1