Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Terri
 
Posts: n/a
Default Macros with Protected Worksheets

Hi,

Can you run a macro when you have the worksheet protected? If so, how do I
get this to work in Excel?
--
Terri
  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default Macros with Protected Worksheets

Terri, one way is to unprotect the sheet run your code and then protect the
sheet all with your code, like this

Sub My_Macro()

Const PW As String = "123" 'Change Password Here

ActiveSheet.Unprotect Password:=PW

'you code here

ActiveSheet.Protect Password:=PW

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Terri" wrote in message
...
Hi,

Can you run a macro when you have the worksheet protected? If so, how do
I
get this to work in Excel?
--
Terri



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM
Using Collapse/Expand with Protected worksheets stuck Excel Discussion (Misc queries) 6 July 22nd 05 02:40 PM
How do i unlock protected worksheets? jamesbialek Excel Worksheet Functions 1 June 22nd 05 01:02 PM
Running Macros in protected workbook petunia Excel Worksheet Functions 3 January 18th 05 09:24 PM
Is is possible to run macros on a protected worksheet petunia Excel Worksheet Functions 1 January 18th 05 04:55 PM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"