+ Reply to Thread
Results 1 to 6 of 6

excel vba - listbox displays 12/30/99 when value is null

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    excel vba - listbox displays 12/30/99 when value is null

    I haven't been able to find anything online similar to this and I'm not sure how to code this. I have a ListBox that list date inputs (beginning and ending dates). Sometimes the inputs are left blank until the user inputs a date. The code works fine for date input and the ListBox displays everything correctly when dates are input, but if dates are blank, the ListBox displays 12/30/99 (12/30/1899). I added an If Then Else statement to the listbox fill routine to look at the row cell value and return a nullvalue if cell is empty or display a date when filled. What I have now, which obviously doesn't work, now leaves the ListBox date value null whether there is a sheet value or not. Anybody see where I'm going astray?
    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: excel vba - listbox displays 12/30/99 when value is null

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: excel vba - listbox displays 12/30/99 when value is null

    Thanks shg for that. I don't think I'm writing it correctly though. It solves the display issue..partially. When there is no date, it still displays the Microsoft default date 12/30/99.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: excel vba - listbox displays 12/30/99 when value is null

    I don't know when you're writing the value to the listbox. Test it then.

  5. #5
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: excel vba - listbox displays 12/30/99 when value is null

    this seemed to have fixed it
    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: excel vba - listbox displays 12/30/99 when value is null

    All's well that ends well.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] excel vba - listbox displays first row when empty
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2017, 06:00 PM
  2. Excel Userform Search Command- Listbox displays results
    By KathyES93 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-07-2017, 02:42 AM
  3. [SOLVED] Why are there Empty/Null/Blank Rows in my ListBox?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-02-2014, 09:25 PM
  4. [SOLVED] Listbox.value is null
    By Hammer_757 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2012, 11:41 AM
  5. [SOLVED] Invalid Use of Null - Formating listbox column
    By chinaboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-24-2012, 02:48 PM
  6. Can't get listbox which displays rows in sheet to add texbox value to selected row
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-02-2010, 01:43 PM
  7. [SOLVED] Macro: Listbox value null
    By jomili in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2009, 04:47 PM

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