vignesh_thegame
New Member
- Joined
- Sep 30, 2013
- Messages
- 48
Hi,
I need to create a Macro to protect a particular worksheet with a password in a workbook.
For example:-
my workbook has a filename "Vignesh.xlxs". i have many sheets in that such as "Jan", "Feb", "Mar", Apr", "May"..... "Dec".
Here i need to protect only "Jan" to "Dec" sheets with same password, and "Jul" sheets must be Editable.
This workbook is a employee details for an year. Like this i have more than 1500 workbooks...
I tried this below macro, but it was protecting all sheets in a workbook. but i need to lock all sheets except one sheet..
Sub Macro4()
'
' Macro4 Macro
'
' Keyboard Shortcut: Ctrl+q
For i = 1 To Sheets.Count
Sheets(i).Protect Password:="vicky", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets(i).EnableSelection = xlUnlockedCells
Next i
End Sub
Can anyone really look into this and help me....
I need to create a Macro to protect a particular worksheet with a password in a workbook.
For example:-
my workbook has a filename "Vignesh.xlxs". i have many sheets in that such as "Jan", "Feb", "Mar", Apr", "May"..... "Dec".
Here i need to protect only "Jan" to "Dec" sheets with same password, and "Jul" sheets must be Editable.
This workbook is a employee details for an year. Like this i have more than 1500 workbooks...
I tried this below macro, but it was protecting all sheets in a workbook. but i need to lock all sheets except one sheet..
Sub Macro4()
'
' Macro4 Macro
'
' Keyboard Shortcut: Ctrl+q
For i = 1 To Sheets.Count
Sheets(i).Protect Password:="vicky", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets(i).EnableSelection = xlUnlockedCells
Next i
End Sub
Can anyone really look into this and help me....