View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alok Alok is offline
external usenet poster
 
Posts: 318
Default Clearing a date vaiable

Hi

Once you have a date variable defined
it will continue to return true to IsDate() function.

You can set the date to 0, to clear the date but that will still return true
to the IsDate function call.

"PSKelligan" wrote:

Hi all,
Hopefully a silly but fast question.

Sub myCode()
Dim myDate As Date

myDate = "" 'Syntax meant for a string...
While Not While Not (IsDate(myDate))
'Misc code here
Wend
End Sub


In the line, myDate = "", what would be the right way to empty this date
variable?
I tried myDate = Nothing and that did not work either.
--
Thanks,

Patrick