Hi
Anybody know the code to protect a sheet against locked cell changes but allowing user changes to unlocked cells?
Also Code for saving a specified sheet as a seperate workbook?
Thanks
(trying to learn VBA is forcing me into alcohol abuse)
Hi
Anybody know the code to protect a sheet against locked cell changes but allowing user changes to unlocked cells?
Also Code for saving a specified sheet as a seperate workbook?
Thanks
(trying to learn VBA is forcing me into alcohol abuse)
QuoteOriginally posted by JJacob
Anybody know the code to protect a sheet against locked cell changes but allowing user changes to unlocked cells?
Sheets("Sheet1").Protect ("Password")
QuoteOriginally posted by JJacob
Also Code for saving a specified sheet as a seperate workbook?
Sheets("Sheet1").Copy
ActiveSheet.SaveAs "YourFileName.xls"
Regards,
Hi Barrie:
When I use the following code:
Password = "Msorbino"
Sheets(1).Protect Password, DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True
Sheets(2).EnableSelection = xlNoSelection
Password = "Msorbino"
Sheets(2).Protect Password, DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True
Password = "Msorbino"
Sheets(3).Protect Password, DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True
Password = "Msorbino"
Sheets(4).Protect Password, DrawingObjects:=True, Contents:=False, Scenarios:=True, UserInterfaceOnly:=True
Password = "Msorbino"
Sheets(5).Protect Password, DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True
Either nothing happens or the unlocked cells in sheet one are also locked.
Also
When I use the save sheet as code, it saves the whole workbook. I have been working on this project for weeks and it is driving me up a wall.
Thanks for your help!
I don't know why unlocked cells are becoming locked. For the sheet saving, you may be omitting the first of Barrie's two lines. The initial copy is needed.
Hi Derk:
Thanks for the help. I didn't realize that the new workbook was created after the copy command.
Big help
Don’t have an account yet? Register yourself now and be a part of our community!