Hi,
A while ago someone on here provided me with the below, but I didn't need it in the end, now I do!
It formats the colours of rows from cells B:R based on B...all good.
I'd like a few tweaks if possible:
1) I have to run the macro each time a change is made, is there a way to make it run itself everytime a cell in column B is changed?
2) It takes a while to run, as I assume it working it's way down through every row, is there a way to limit from say row 1 to 500?
3) General query - how do I assign a key command to run the macro.
Sorry for all the questions, hopefully if I can get this working I can apply this to a template and use it on many spreadsheets, saving me alot of time day to day!
Thanks,
Dan
Sub HighlightExisting()
Dim Cll As Range
For Each Cll In Range("B:B")
Select Case Cll
Case Is = "IGNORE"
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.ColorIndex = 10
Case Is = "To Be Done"
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.ColorIndex = 16
Case Is = "Pass"
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.ColorIndex = 9
Case Is = "Fail"
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.ColorIndex = 3
Case Is = "In Progress"
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.ColorIndex = 5
Case Else
Range("B" & Cll.Row & ":R" & Cll.Row).Interior.Pattern = xlNone
End Select
Next Cll
End Sub
Bookmarks