VBA to Protect sheets & keep some options on
Solved/Closed
Related:
- VBA to Protect sheets & keep some options on
- Vba case like - Guide
- Sheets right to left - Guide
- Number to words in excel formula without vba - Guide
- Shortcut to internet options - Guide
- Netflix payment options - Guide
1 response
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
Apr 13, 2011 at 08:18 AM
Apr 13, 2011 at 08:18 AM
replace following line in your code of Private Sub CommandButton1_Click()
with
WS.Protect Password:=PW
with
WS.Protect Password:=PW, DrawingObjects:=False, Contents:=True, Scenarios:= True, AllowFormattingRows:=True WS.EnableSelection = xlNoSelection
Apr 13, 2011 at 01:19 PM
Thank you very much, it works as I need, really thank you and I appreciate it.
Sorry, but I need now something else if you can, I have 50 sheets in excel and all are the same in every thing (format, no of rows, columns, ...etc), so each sheet belong to one supplier and in each sheet there are 3 checkboxes. I already made VBA for each checkbox that if I clicked the checkbox (True) the VBA will do something (i.e. to hide some rows, ...etc), but what I need now to make module instead of copying and pasting the same VBA in all 50 sheets, can I do it??
Here is my VBA:
Private Sub CheckBox1_Click()
If CheckBox15 = False Then
Range("A52:W89").Select
Selection.EntireRow.Hidden = True
Else:
Range("A52:W89").Select
Selection.EntireRow.Hidden = False
End If
End Sub
*****************************
Private Sub CheckBox2_Click()
If CheckBox16 = False Then
Range("A90:W132").Select
Selection.EntireRow.Hidden = True
Else:
Range("A90:W132").Select
Selection.EntireRow.Hidden = False
End If
End Sub
Many thanks in advance.