Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Application.ScreenUpdating = False
- Dim cell As Range
- 'Turn off ScreenUpdating (speeds up code)
- Application.ScreenUpdating = False
- 'Loop through each cell in the ActiveSheet
- For Each cell In ActiveSheet.UsedRange
- 'Check for a specific fill color
- If cell.Interior.Color = RGB(255, 255, 0) Then
- 'Remove Fill Color
- cell.Interior.Color = xlNone
- End If
- Next cell
- ' Highlight the active cell
- Target.Interior.ColorIndex = 6
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement