Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to put a formula in R2 that says - =if(S2 MYDATE,1,if(s2 =
mydate,3,2)) Here is the code I have: Dim CURRDATE As Date Dim MYDATE As Date CURRDATE = Date - 6 '10/20/2005 MYDATE = Format(CURRDATE, "mm/dd/yyyy") Columns("S:S").Select Selection.NumberFormat = "mm/dd/yyyy" Range("R2").FormulaR1C1 = ("=IF(RC[1]" & MYDATE & ",1,IF(RC[1]=" & MYDATE & ",3,2))") For some reason, R2 is always returning a result of 1 when it should return the result of 3 or 2 when the date equals or falls below the MYDATE? Any Suggestions? Thanks in Advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA formula in macro not working | Excel Discussion (Misc queries) | |||
Formula within a Macro not working as expected. | New Users to Excel | |||
macro not working | Excel Discussion (Misc queries) | |||
macro was working, now it's not working | Excel Programming | |||
Macro working in Excel 2003; not working in Excel 2000 | Excel Programming |