girapas
Board Regular
- Joined
- Apr 20, 2004
- Messages
- 150
In Sheet1 I have 4 buttons to call the corresponding sub (say page1, page2, page3, page4) that goes to a specific range in Sheet2 (say rng1, rng2, rng3, rng4). I use the following code:
Sub page1()
Set rng1 = ActiveWorkbook.Worksheets("Sheet2").Range("B1:J20")
Application.Goto rng1, True
End Sub
Sub page2()
Set rng2 = ActiveWorkbook.Worksheets("Sheet2").Range("L1:T20")
Application.Goto rng2, True
End Sub
and so on.
That works fine, expect if I want to prevent the user to select some cells in Sheet2, that must be both protected and not selected, adding that in subs page1, page2, page3, page4:
ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Contents:=True
Is there any way to override it?
Thanks in advance...
Sub page1()
Set rng1 = ActiveWorkbook.Worksheets("Sheet2").Range("B1:J20")
Application.Goto rng1, True
End Sub
Sub page2()
Set rng2 = ActiveWorkbook.Worksheets("Sheet2").Range("L1:T20")
Application.Goto rng2, True
End Sub
and so on.
That works fine, expect if I want to prevent the user to select some cells in Sheet2, that must be both protected and not selected, adding that in subs page1, page2, page3, page4:
ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Contents:=True
Is there any way to override it?
Thanks in advance...
Last edited: