srmammadov
New Member
- Joined
- May 7, 2015
- Messages
- 3
dears,
I need help. Please help me.
I want to unprotect protected worksheet (Sheet2), write something and protect it via ActiveX Control button.
Everything should be done by clicking that button. I know protect/unprotect code in VBA, but dont know how to write (run macros) between. So, my macros is:
Sub save()'
' save Macro
'
' Keyboard Shortcut: Ctrl+w
'
Range("A2:I2").Select
Selection.Copy
Sheets("Archive").Select
Range("A2").Select
Selection.Insert Shift:=xlDown
Range("A2").Select
Sheets("Base").Select
Range("A2").Select
Application.CutCopyMode = False
ActiveWorkbook.save
End Sub
On clicking that button:
1. Worksheet will be unprotected
2. my macros will be ran
3. Worksheet will be protected
I need help. Please help me.
I want to unprotect protected worksheet (Sheet2), write something and protect it via ActiveX Control button.
Everything should be done by clicking that button. I know protect/unprotect code in VBA, but dont know how to write (run macros) between. So, my macros is:
Sub save()'
' save Macro
'
' Keyboard Shortcut: Ctrl+w
'
Range("A2:I2").Select
Selection.Copy
Sheets("Archive").Select
Range("A2").Select
Selection.Insert Shift:=xlDown
Range("A2").Select
Sheets("Base").Select
Range("A2").Select
Application.CutCopyMode = False
ActiveWorkbook.save
End Sub
On clicking that button:
1. Worksheet will be unprotected
2. my macros will be ran
3. Worksheet will be protected