Dear Experts
I search through the forum and tried to improvise but it seems it is not working.
Wish to repeat a macro through different sheet name but the looping only on the first sheet.
Any help would be great. Thank you. Appreciate it.
I search through the forum and tried to improvise but it seems it is not working.
Wish to repeat a macro through different sheet name but the looping only on the first sheet.
VBA Code:
Sub Test()
Dim Sh As Worksheet
For Each Sh In ActiveWorkbook.Worksheets
If Sh.Name <> "Inp*" Then
With Sh
Dim c As Range
For Each c In Range("1:1").Cells
If c.Value = "Lock" Then
c.EntireColumn.Select
Selection.Locked = True
End If
Next c
End With
End If
Next Sh
End Sub
Any help would be great. Thank you. Appreciate it.