combatvolcano
Board Regular
- Joined
- Jan 13, 2010
- Messages
- 69
I have tried several ways of doing this...
I have a cell on the "settings" sheet which is a date time formatted as the *standard mm/dd/yyyy
I have tried either dim'ing my variable dd as date or not and assign it using
I am trying to compare this to another date/time
When I use a msgbox to look at the other date/time I see a valid date/time in the msgbox (even when using DateValue() on it)
If I do the same thing to "dd" I get " 12:00:00 AM"
It seems this is actually the value because if I try DateDiff I get a huge -number????
Even this doesn't seem to work!
I am confused, I just want to compare two date/times in VBA to if one is greater! (and delete the row if it is lesser but I have a handle on that part)
thank you!
I have a cell on the "settings" sheet which is a date time formatted as the *standard mm/dd/yyyy
I have tried either dim'ing my variable dd as date or not and assign it using
Code:
dd = sheets("settings").Range("b2").Value
I am trying to compare this to another date/time
When I use a msgbox to look at the other date/time I see a valid date/time in the msgbox (even when using DateValue() on it)
If I do the same thing to "dd" I get " 12:00:00 AM"
It seems this is actually the value because if I try DateDiff I get a huge -number????
Even this doesn't seem to work!
Code:
ddy = Year(Sheets("SETTINGS").Range("B2").Value)
ddm = Month(Sheets("SETTINGS").Range("B2").Value)
ddd = Day(Sheets("SETTINGS").Range("B2").Value)
dd = DateSerial(ddy, ddm, ddd)
MsgBox (dd)
thank you!