I want my macro to look through each cell in the specified worksheets and then remove the specified fill colors from any of the cells. It is working properly for the first sheet but nothing is happening in the other two sheets. It is running all the way through the code without any errors and I do end up on the Home sheet, but I think I am missing a minor detail -- Any help would be greatly appreciated!
Here is my current code:
Here is my current code:
VBA Code:
Public Sub Remove_Fill()
Dim SC As Worksheet, RB As Worksheet, Comp As Worksheet, Home As Worksheet
Dim cell As Range
Application.ScreenUpdating = False
Set Home = Sheets("MACROS")
Set SC = Sheets("SC")
Set RB = Sheets("New RB")
Set Comp = Sheets("Comparison")
SC.Select
For Each cell In SC.UsedRange 'Loop through each cell in the ActiveSheet
If cell.Interior.Color = RGB(255, 255, 0) Then 'Check for a specific fill color
cell.Interior.Color = xlNone 'Remove Fill Color
End If
If cell.Interior.Color = RGB(146, 208, 80) Then
cell.Interior.Color = xlNone
End If
Application.CutCopyMode = False
GoTo RB
Next cell
RB:
RB.Select
For Each cell In SC.UsedRange 'Loop through each cell in the ActiveSheet
If cell.Interior.Color = RGB(255, 255, 0) Then 'Check for a specific fill color
cell.Interior.Color = xlNone 'Remove Fill Color
End If
If cell.Interior.Color = RGB(146, 208, 80) Then
cell.Interior.Color = xlNone
End If
Application.CutCopyMode = False
Next cell
GoTo Comp
Comp:
Comp.Select
For Each cell In SC.UsedRange 'Loop through each cell in the ActiveSheet
If cell.Interior.Color = RGB(255, 255, 0) Then 'Check for a specific fill color
cell.Interior.Color = xlNone 'Remove Fill Color
End If
If cell.Interior.Color = RGB(146, 208, 80) Then
cell.Interior.Color = xlNone
End If
Application.CutCopyMode = False
Next cell
GoTo Ending
Ending:
Application.ScreenUpdating = True
Home.Select
End Sub