Try this:
Sub recent()
sorter_col = Cells.Find("Spread", [A1], , , xlByColumns, xlPrevious).Column
Dim rg As Range
Dim cond1 As FormatCondition, cond2 As FormatCondition
Set rg = Cells.Columns(sorter_col)
Cells.Columns(sorter_col).Select
'clear any existing conditional formatting
rg.FormatConditions.Delete
'define the rule for each conditional format
Set cond1 = rg.FormatConditions.Add(xlCellValue, xlGreater, "=1")
Set cond2 = rg.FormatConditions.Add(xlCellValue, xlLessEqual, "=1")
rg.FormatConditions(1).NumberFormat = "0.0"
rg.FormatConditions(2).NumberFormat = "0.00"
End With
End Sub
I hope this helps, please let me know!
Regards,
David
If this has been helpful
- Please click on the *Add Reputation button at the bottom left.
Please mark your thread as SOLVED:
- Click Thread Tools above your first post, select "Mark your thread as Solved".
Bookmarks