Thread: Date to nothing
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Julian Milano[_2_] Julian Milano[_2_] is offline
external usenet poster
 
Posts: 19
Default Date to nothing

Try:

strDate = Empty


--

Julian Milano


"andyathome " wrote in message
...
Seeing another post, I noticed that you can format dates from cells:

i.e.

strDate = Format(Cells(selection, "A"), "dd/mm/yyyy")

That sounds idea for what I need. However, I guess I need to set the
variable strDate to a Date.

i.e.

Dim strDate as Date

That is great. But what I need to do is also have a condition that sets
the strDate variable to nothing if a condition is true

i.e.

If strCondition = "1" then

strDate = Format(Cells(selection, "A"), "dd/mm/yyyy")

Else

strDate = ""

End if

When I tried this, it said Type Mismatch. Obviously I need to wipe the
old date out from the variable stDate everytime I loop through. Is
there a way to set a date to nothing?

Any help is appreciated.


---
Message posted from http://www.ExcelForum.com/