Hello, I have this macro to unlock and highlight cells in a range that should apply to the same range in each sheet of the workbook. It works great on the active sheet but it isn't looping. I'm guessing it's an issue with the range reference from sheet to sheet but I can't seem to get it, any help is very much appreciated. Thank you
Sub Unlock_and_Highlight()
Dim Pd5 As Range
Dim ws As Worksheet
Set Pd5 = Range("N3:N8,N11:N20")
For Each ws In ThisWorkbook.Worksheets
If ws.Range("N2") = "Yes" Then Pd5.Locked = False
If ws.Range("N2") = "Yes" Then Pd5.Interior.Color = RGB(220, 220, 220)
Next ws
End Sub
Sub Unlock_and_Highlight()
Dim Pd5 As Range
Dim ws As Worksheet
Set Pd5 = Range("N3:N8,N11:N20")
For Each ws In ThisWorkbook.Worksheets
If ws.Range("N2") = "Yes" Then Pd5.Locked = False
If ws.Range("N2") = "Yes" Then Pd5.Interior.Color = RGB(220, 220, 220)
Next ws
End Sub