+ Reply to Thread
Results 1 to 4 of 4

Populate listbox with current date value

  1. #1
    Registered User
    Join Date
    10-10-2008
    Location
    Illinois
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    85

    Populate listbox with current date value

    I am trying to populate a listbox in a userform with only certain data. Currently I am able to populate all rows in a worksheet but I need to have only rows with the current date to show. In col A is the date and col B is a persons name.
    Please Login or Register  to view this content.
    Thanks for any help.
    Attached Files Attached Files
    Last edited by Khaos176; 02-25-2009 at 12:28 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,629

    Re: Populate listbox with current date value

    The code below fills an array with data from rows with dates then initializes the list box with the array data:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-10-2008
    Location
    Illinois
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    85

    Re: Populate listbox with current date value

    Thank you protonLeah it works exactly as I said I needed it. I thought once I understood how to accomplish this I could use it to complete a form. I have run into a couple of problems that have me currently stumped. For simplicity I said 2 columns DATE and NAME actually there are 8 columns and 2 of them are time. This is where my first problem occurs the list box is giving decimal values instead of time values. The second problem is I wanted to use heading and they no longer are working. I have attached a NEW workbook to show my progress and I will continue to try and make it work. Any help is appreciated.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Khaos176; 02-25-2009 at 10:16 AM.

  4. #4
    Registered User
    Join Date
    10-10-2008
    Location
    Illinois
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    85

    Re: Populate listbox with current date value

    Ok I figured it out. I substituted the code "Format(testVal.Offset(0, 2), "h:mm AM/PM")" to fix the format issue and for the column headings I just used labels instead. Thanks again for the help.

+ 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