zprilliman
New Member
- Joined
- Apr 22, 2014
- Messages
- 6
Good evening,
I am trying to clean up a macro that I recorded with the recorder. Its basic function of the macro is to filter all the data labeled to Phoenix (Column B), paste it on a new tab and then sort and subtotal by column G. I've gotten the majority of that accomplished, but I tried adding some extra tasks in the macro and I'm not sure how to clean it up. I feel like I'm 99% there, I need to reconfigure a portion of the macro to basically state that if the cells in Column K are RGB (255, 255, 255) to conditionally format them. I only need the white cells with values to be part of the formatting. I used the recorder to build the conditional formatting but I can't figure out how to write the If statement to make it valid.
I am trying to clean up a macro that I recorded with the recorder. Its basic function of the macro is to filter all the data labeled to Phoenix (Column B), paste it on a new tab and then sort and subtotal by column G. I've gotten the majority of that accomplished, but I tried adding some extra tasks in the macro and I'm not sure how to clean it up. I feel like I'm 99% there, I need to reconfigure a portion of the macro to basically state that if the cells in Column K are RGB (255, 255, 255) to conditionally format them. I only need the white cells with values to be part of the formatting. I used the recorder to build the conditional formatting but I can't figure out how to write the If statement to make it valid.
Rich (BB code):
'Format cost column
Range(Range("K2"), Range("K2").End(xlDown)).Select
Selection.NumberFormat = "#,##0.00_);[Red](#,##0.00)"
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=500"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
EndWith
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
Formula1:="=-500"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
Selection.FormatConditions(1).StopIfTrue = False
EndWith