A
andyathome
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.
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.