Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Clearing a date vaiable

Sub myCode()
dim myDate As Date

myDate = Empty
While Not (IsDate(myDate))
'Misc code here
Wend


End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alok" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE CAPTGNVR Excel Discussion (Misc queries) 5 February 2nd 07 07:05 PM
Clearing data past its sell by date! simoncottle Excel Discussion (Misc queries) 1 April 4th 06 12:10 AM
vaiable colours for selection in chart NoelH Charts and Charting in Excel 4 October 27th 05 04:43 AM
Assign vaiable to a cell - gold gold gold via OfficeKB.com Excel Worksheet Functions 1 June 4th 05 04:31 AM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"