Hi there
Is there a way to password protect a worksheet using VBA?
I'm trying to password protect a sheet with the password "coffee".
However when I record and run a a macro to do this, the sheet is protected but without a password. Ie the VBA code does not state that the password must be coffee, it just protects the sheet without a password.
Below is the code the code generated by the macro:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Is there a way to password protect a worksheet using VBA?
I'm trying to password protect a sheet with the password "coffee".
However when I record and run a a macro to do this, the sheet is protected but without a password. Ie the VBA code does not state that the password must be coffee, it just protects the sheet without a password.
Below is the code the code generated by the macro:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True