S
Stuart
I wish to check that a complicated (for me) protection routine is
coded and operating correctly.
Addin code allows a User to select their workbook(s) and then
continues to open their selection. As it does so, code ends with
.Protect
.EnableSelection = xlUnlockedCells
Can I say something like:
Sub Test_Protection()
Dim ws As Worksheet, c As Range
For Each ws In ActiveWorkbook.Worksheets
With ws
For Each c In .UsedRange.Columns("A:G")
If Not c.Locked = True Then
'User is permitted to edit this cell, so color it:
c.Interior.ColorIndex = 34
End If
Next
End With
Next
End Sub
This doesn't work for me.
Regards.
coded and operating correctly.
Addin code allows a User to select their workbook(s) and then
continues to open their selection. As it does so, code ends with
.Protect
.EnableSelection = xlUnlockedCells
Can I say something like:
Sub Test_Protection()
Dim ws As Worksheet, c As Range
For Each ws In ActiveWorkbook.Worksheets
With ws
For Each c In .UsedRange.Columns("A:G")
If Not c.Locked = True Then
'User is permitted to edit this cell, so color it:
c.Interior.ColorIndex = 34
End If
Next
End With
Next
End Sub
This doesn't work for me.
Regards.