Private Sub EditOpen()
Dim book As Workbook
Dim sheet As Worksheet
For Each book In Workbooks
If Not book.ReadOnly Then
Set sheet = book.Worksheets("Operating")
sheet.Range("$K$13:$K$18,$K$21:$K$26,$K$29:$K$34,$K$37:$K$42,$K$45:$K$50,$K$53:$K$58,$K$61:$K$66,$K$69:$K$74,$K$77:$K$82,$K$85:$K$90,$K$93:$K$98,$K$101:$K$106").Locked = False
Set sheet = Nothing
End If
Next
End Sub
When I run this code I get a run-time error 9: "Subscript out of Range". Can anyone tell me what my problem is?
Dim book As Workbook
Dim sheet As Worksheet
For Each book In Workbooks
If Not book.ReadOnly Then
Set sheet = book.Worksheets("Operating")
sheet.Range("$K$13:$K$18,$K$21:$K$26,$K$29:$K$34,$K$37:$K$42,$K$45:$K$50,$K$53:$K$58,$K$61:$K$66,$K$69:$K$74,$K$77:$K$82,$K$85:$K$90,$K$93:$K$98,$K$101:$K$106").Locked = False
Set sheet = Nothing
End If
Next
End Sub
When I run this code I get a run-time error 9: "Subscript out of Range". Can anyone tell me what my problem is?