I have a long string of dates to put into the combobox. it's sorted from the oldest date to the latest date. however, the user only needs the few latest dates.
is there a way to sort the combobox in vb form to show the latest date first?
I have a long string of dates to put into the combobox. it's sorted from the oldest date to the latest date. however, the user only needs the few latest dates.
is there a way to sort the combobox in vb form to show the latest date first?
Hello Excelsmu,
If you are loading the ComboBox from a Range on a worksheet then you can use a macro to sort the date Range in order of oldest to newest date, and then load the ComboBox. Or are you loading it differently?
Sincerely,
Leith Ross
i'm doing it differently because there will be new dates entered on a regular basis. so the new dates would be at the bottom.
is there anyway to sort it in vb?
Hello excelsmu,
There are no built-in sort routines in VBA. You would have to create one. You say your dates are in a long string. Are you parsing the dates from this string and putting the dates into the ComboBox then? It might be best if you can provide a sample of your code or upload your workbook. It would expedite answering your question.
Sincerely,
Leith Ross
Thanks Leith, I've uploaded the excel sheet. due to the big file size, i've cut down many things. hope it still work though.
Going into the 'Daily inventory level', there's a form button which allows a form to pop up. Before the 'sorting of date' problem, i have another problem with this form too.
the form would show a dropdown menu of the outlet at B2:b4. after user select the outlet, i'm figuring out whether i can make the next combobox go to the relevant worksheet and get the correct set of date.
I'm stuck at this part where i've no idea how to link to another worksheet.
Then it would be the 'sorting of date' problem.![]()
Dim FindIng As Range Dim matching as String 'matching the outlet with the worksheet name Set FindIng = Range("b:b").Find(what:=ComboBox4.Value) Set matching = FindIng.offset(0,1).Caption
There's no attachment, have you zipped the file?
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks