totalnatal
New Member
- Joined
- Jun 9, 2010
- Messages
- 33
Hi,
I have the following lines of code:
where r = Range("a3").Offset(i, 0).Value
Both r and Range("a3").Offset(i, 17).Value correspond ot cells which have a date in it. The date in r is calculated by vba whereas the one in the offset is calculated via formula.
As you can see, I'm trying to do something like: If r is less than the offset cell value (i.e 15/06/2007 < 24.04.2007) then do a set of commands.
for some reason everytime I run the macro, it does not to the comparison properly as the set of commands still gets executed even if R is not less than the offset cell value.
Can you help me ?
Thank you
I have the following lines of code:
Code:
If r < Range("a3").Offset(i, 17).Value Then
Range(Range("a3").Offset(s, 4), Range("a3").Offset(s, 9)).Value = 0
where r = Range("a3").Offset(i, 0).Value
Both r and Range("a3").Offset(i, 17).Value correspond ot cells which have a date in it. The date in r is calculated by vba whereas the one in the offset is calculated via formula.
As you can see, I'm trying to do something like: If r is less than the offset cell value (i.e 15/06/2007 < 24.04.2007) then do a set of commands.
for some reason everytime I run the macro, it does not to the comparison properly as the set of commands still gets executed even if R is not less than the offset cell value.
Can you help me ?
Thank you