+ Reply to Thread
Results 1 to 8 of 8

Sorting the dates in the combobox

Hybrid View

excelsmu Sorting the dates in the... 11-04-2007, 03:02 AM
Leith Ross Hello Excelsmu, If you are... 11-04-2007, 03:27 AM
excelsmu i'm doing it differently... 11-04-2007, 04:44 AM
Leith Ross Hello excelsmu, There are... 11-04-2007, 05:02 AM
excelsmu Thanks Leith, I've uploaded... 11-04-2007, 05:38 AM
  1. #1
    Registered User
    Join Date
    09-17-2007
    Posts
    12

    Sorting the dates in the combobox

    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?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    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

  3. #3
    Registered User
    Join Date
    09-17-2007
    Posts
    12
    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?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    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

  5. #5
    Registered User
    Join Date
    09-17-2007
    Posts
    12
    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.
     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
    Then it would be the 'sorting of date' problem.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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