ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using a password to in connection with macro protectio (https://www.excelbanter.com/excel-programming/319087-using-password-connection-macro-protectio.html)

Brian

using a password to in connection with macro protectio
 
Hello,

I added a password to the worksheet protection and then recieved a runtime
error related to this macro. Password is 1234, how can I insert the use of a
password into this macro?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/28/2004 by bmd
'

'
ActiveSheet.Unprotect
Range("D9:D82").Select
Selection.ClearContents
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Thank You,
Brian


Frank Kabel

using a password to in connection with macro protectio
 
Hi
Sub Macro1()
ActiveSheet.Unprotect password:="1234"
Range("D9:D82").Select
Selection.ClearContents
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect password:="1234", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany
"Brian" schrieb im Newsbeitrag
...
Hello,

I added a password to the worksheet protection and then recieved a runtime
error related to this macro. Password is 1234, how can I insert the use of
a
password into this macro?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/28/2004 by bmd
'

'
ActiveSheet.Unprotect
Range("D9:D82").Select
Selection.ClearContents
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
End Sub

Thank You,
Brian




Tim Williams

using a password to in connection with macro protectio
 

Sub Macro1()
const PW as string="1234"

ActiveSheet.Unprotect PW
Range("D9:D82").Select
Selection.ClearContents
'Selection.Locked = False 'locked cells don't matter if the sheet
is not protected
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True;password:=PW
End Sub


Tim

"Brian" wrote in message
...
Hello,

I added a password to the worksheet protection and then recieved a
runtime
error related to this macro. Password is 1234, how can I insert the
use of a
password into this macro?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/28/2004 by bmd
'

'
ActiveSheet.Unprotect
Range("D9:D82").Select
Selection.ClearContents
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
End Sub

Thank You,
Brian





All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com