Dear All,
What is the VBA script for dynamic combobox list item that will change by the date on E2 and shorted with no duplicate? for example, if date 17-May-2017 then on combobox list item will be "aaa,bbb,ccc".
Thank you
Omega Boost
Dear All,
What is the VBA script for dynamic combobox list item that will change by the date on E2 and shorted with no duplicate? for example, if date 17-May-2017 then on combobox list item will be "aaa,bbb,ccc".
Thank you
Omega Boost
Instead of using a Form Control, try ActiveX control which is easier and flexible to work with.
Place the following code on Sheet Module and enter a date in E2 to see if the combobox is populated with the correct items.
For details, refer to the attached.Please Login or Register to view this content.
Last edited by sktneer; 05-21-2017 at 07:01 AM.
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
Why is an ActiveX any easier for this scenario? Must be missing that bit as in general one should avoid ActiveX controls on worksheets wherever possible
Dear sktneer,
Thank you for the solution and it's perfect. Just wondering is it possible to set x range without using CurrentRegion? Cause i will apply this script on table that have several columns, and the date column might be not in the first column. Thank you
You're welcome!
In that case you can try like x = Range("A1:E500").Value or declare a variable to hold the rows on the sheet dynamically and then try x = Range("A1:E" & lr).Value where lr is the last row used on the sheet.
In the line If x(i, 1) = Target.Value Then, 1 here assumes that the date is the first column and if the date column is not the first column, you must change it as per your requirement.
Dear sktneer,
Many Thanks for your help. I already apply your script as per your advice and it's work perfectly.
Regards
Omega Boost
You're welcome Omega! Glad it worked.
Thanks for the feedback.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks