+ Reply to Thread
Results 1 to 6 of 6

Date Variable - Clearing the Value

  1. #1
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Exclamation Date Variable - Clearing the Value

    I have a variable that has been declared as a Date. My code runs through a few lines of a spreadsheet making a comparison using the date variable. I then need to clear the varible before moving to the next lines to be compared.

    How do you set a date varible to blank or nothing or null or whatever an empty date variable is set to.

    This may be a simple question, but sometimes the simplest things seem to be the absolute hardest to find the answer to.

    Thanks!

    Jeff

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    One way:

    myVar = ""

  3. #3
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    I get a Data Type Mismatch when I use

    myvar = ""

    Jeff

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Sorry about that. I was reading too fast. A date needs:

    myvar = 0

    -or-

    myvar = Empty

    These will not empty the value, but they will translate to "12/30/1899 00:00:00". Will this work for you?

  5. #5
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    myvar = Empty works great!

    Thank you, jason

    Jeff

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    No problem, Jeff.

+ 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