Hi Guys,
Macro is not working :(
So the macro I am using is supposed to look back at all the months tab, match the Name from previous tabs and if they match change background color of the active sheet's cell to red.
Right now the macro is only able to lookup the name in the previous tab (i.e. For December it will only lookup November tab and not October-January).
e.g. (Candidate name is Jack King and he is in (octobers tab, Column A Cell 2 )
I want this candidate name to turn red once I type his name in November/December tab.
I have pasted the code I am using below
Any help would be appreciated.
Macro is not working :(
So the macro I am using is supposed to look back at all the months tab, match the Name from previous tabs and if they match change background color of the active sheet's cell to red.
Right now the macro is only able to lookup the name in the previous tab (i.e. For December it will only lookup November tab and not October-January).
e.g. (Candidate name is Jack King and he is in (octobers tab, Column A Cell 2 )
I want this candidate name to turn red once I type his name in November/December tab.
I have pasted the code I am using below
Any help would be appreciated.
Code:
Sub December()
'
Dim rcell As Range
Dim ccell As Range
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim ws3 As Worksheet
Dim ws4 As Worksheet
Dim ws5 As Worksheet
Dim ws6 As Worksheet
Dim ws7 As Worksheet
Dim ws8 As Worksheet
Dim ws9 As Worksheet
Dim ws10 As Worksheet
Dim ws11 As Worksheet
Dim ws12 As Worksheet
Application.ScreenUpdating = False
Set ws = Sheets("January")
Set ws2 = Sheets("February")
Set ws3 = Sheets("March")
Set ws4 = Sheets("April")
Set ws5 = Sheets("May")
Set ws6 = Sheets("June")
Set ws7 = Sheets("July")
Set ws8 = Sheets("August")
Set ws9 = Sheets("September")
Set ws10 = Sheets("October")
Set ws11 = Sheets("November")
Set ws12 = Sheets("December")
ws12.Activate
For Each rcell In Range("A2:A" & ActiveSheet.UsedRange.Rows.Count)
ws.Activate
ws2.Activate
ws3.Activate
ws4.Activate
ws5.Activate
ws6.Activate
ws7.Activate
ws8.Activate
ws9.Activate
ws10.Activate
ws11.Activate
Set ccell = Rows("1:" & ActiveSheet.UsedRange.Rows.Count).Find(What:=rcell.Value, After:=Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not ccell Is Nothing Then rcell.Interior.ColorIndex = 3
ws12.Activate
Next rcell
End Sub