OfficeUser
Well-known Member
- Joined
- Feb 4, 2010
- Messages
- 544
- Office Version
- 365
- 2016
- Platform
- Windows
I am using this to try and loop through all worksheets and change one cell. Problem is it only will alter the active sheet from which I was on when I trigger the macro. Any suggestions?
Code:
Sub ChangeAll()
Dim Current As Worksheet
For Each Current In Worksheets
ActiveSheet.Unprotect Password:="password"
Range("B6").Value = "Off"
ActiveSheet.Protect Password:="password"
Next
End Sub