sethmeister21
New Member
- Joined
- Mar 10, 2010
- Messages
- 20
Hi All, I've hacked together a macro that looks at my sheet and loops down highlighting certain criteria on the way e.g. if it says "Bankruptcy" or "Failure" it highlights the whole row with colour 42. Great. However, this works fine until I hit a blank cell...then its stops! I need it to keep going even if it hits a blank cell. The max amount of rows will be 32,000 so if I can set a Range (something like D1:D32000) this may be more efficient?
Anyway the main issue is to keep the Macro running even after the blanks until it has reached the last active cell. Please help! I've tried a few things with no success.
Anyway the main issue is to keep the Macro running even after the blanks until it has reached the last active cell. Please help! I've tried a few things with no success.
Sub Highlight_Event()
Do Until IsEmpty(ActiveCell)
Select Case ActiveCell.Text
Case "Bankruptcy"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Failure"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Monkey"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Tennis"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Hotmail"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case ""
ActiveCell.EntireRow.Interior.ColorIndex = -4142
End Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Do Until IsEmpty(ActiveCell)
Select Case ActiveCell.Text
Case "Bankruptcy"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Failure"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Monkey"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Tennis"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case "Hotmail"
ActiveCell.EntireRow.Interior.ColorIndex = 42
Case ""
ActiveCell.EntireRow.Interior.ColorIndex = -4142
End Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub