Looking for a code to populate a list based on selection on another listbox
e.g, if user selects Month in listbox1, listbox2 should populate with - Jan, Feb, Mar etc
Looking for a code to populate a list based on selection on another listbox
e.g, if user selects Month in listbox1, listbox2 should populate with - Jan, Feb, Mar etc
Last edited by Biplab1985; 08-15-2016 at 08:10 AM.
Run a for next loop to go through each row of data for your second data set checking if the selection of listbox1 matched the relevant column and add the data row by row.
EG listbox 1 = Month
data source for listbox 2 =
so the following code would fill the Listbox2;![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Isskint, i get satisfaction out of helping others
How to declare the data source? I tried using Format option to define the range but only the first Column populates
Thanks!
Not sure what you mean by Format option?
However, you need to make sure you have changed the listbox's column count property to the number of columns of data you have.
To add more than 1 column of data per my earlier example, use the Column() method;
![]()
Please Login or Register to view this content.
I meant Format Control of listbox. I think I am missing to declare the variable
Could you please tell me. How do I do the below?
data source for listbox 2 =
How to declare the data source? I am not using userform
Last edited by Biplab1985; 08-15-2016 at 12:36 PM.
any suggestion?
I am not sure about your requirements. But see the attachment if you are trying something like that.
This should work. I am trying to build a dashboard of result using these parameters on selection from access through VBA. Would i be able to work using these listbox selection to get the result of metrics such as volume, FCR% etc.
What i m trying to say to say is user selects from list box say year 2015 and get the volume metrics in excel from access database. The reason i m using access DB is because the data is huge for excel to hold it.
Any suggestion would be very helpful.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks