Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formating Copy/Paste
I am inserting conditional formats on a spreadsheet, but it keeps hanging up
on the first .Add (xlExpression,...) of the below VBA. I am not sure what I am missing. This is what I want it to do. If J2 is less than 60 days from today, hightlight A2:J2 color 34...or if J2 is less than 30 days from today, highlight A2:J2 color 36...or if today is after J2 then highlight A2:J2 color 38. Then copy the formating from row 2 down to the last row of data. With Range("a2:j2").FormatConditions .Delete .Add(xlExpression, , "=and($i2<=(today()+60),$i2(today()+30),$a2<"")" ).Interior.ColorIndex = 34 .Add(xlExpression, , "=and($i2<=(today()+30),$i2(today()),$a2<"")").I nterior.ColorIndex = 36 .Add(xlExpression, , "=and($i4<today(),$a2<"")").Interior.ColorInd ex = 38 End With With Range("a2:j2") .Copy Range("a2:j" & Range("j65536").End(xlUp).Row).PasteSpecial xlPasteFormats End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I have Paste Link copy formating? | Excel Discussion (Misc queries) | |||
??? Copy conditional formating | Excel Discussion (Misc queries) | |||
[Q] Protecting a formating against Copy Paste | Excel Programming | |||
How do i copy conditional formating formulas from 1 row to rest | Excel Discussion (Misc queries) | |||
can i freeze conditional formating to copy to another worksheet | Excel Discussion (Misc queries) |