Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to execute a macro in a protected worksheet?

I create a new macro in my spreadsheet, and now I can't protect it because
the macro won't work. please let me know.
thks
Hanoi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default How to execute a macro in a protected worksheet?

Hanoi, one way,

Const PW As String = "123" 'Change Password Here
ActiveSheet.Unprotect Password:=PW
'you code here
ActiveSheet.Protect Password:=PW


--
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

"Ha Noi" <Ha wrote in message
...
I create a new macro in my spreadsheet, and now I can't protect it because
the macro won't work. please let me know.
thks
Hanoi



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How to execute a macro in a protected worksheet?

I was delighted to find your exchange with Hanoi, as he had exactly the same
problem as I do and it seems you solved it perfectly. Unfortunately...and I
hope you don't mind me asking this...I don't completely understand how to use
your instructions. Is it included in the macro, and what impact will this
have on the end user?

(BTW, my workbook is two spreadsheets - one for data entry (in Columns b to
F)against particular dates (in Column A) . Sheet Two is formatted to look
like a standard calendar, the rows under each day containing formulas to
VLOOKUP the data in Spreadsheet One. My macro autofits the row heights, as
cells in Columns B-F can be either blank or full of text.)

If you could indulge my ingnorance, I would be very appreciative.
Regards,
Vibeke

"Paul B" wrote:

Hanoi, one way,

Const PW As String = "123" 'Change Password Here
ActiveSheet.Unprotect Password:=PW
'you code here
ActiveSheet.Protect Password:=PW


--
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

"Ha Noi" <Ha wrote in message
...
I create a new macro in my spreadsheet, and now I can't protect it because
the macro won't work. please let me know.
thks
Hanoi




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
Macro in a protected worksheet PA Excel Programming 4 April 25th 06 04:19 AM
How can I make macros execute on a protected sheet? J Scott Excel Programming 2 July 26th 05 04:02 PM
How can I run a macro in a protected worksheet? Husker87 Excel Worksheet Functions 2 March 30th 05 11:14 PM
Protected worksheet and macro Massimiliano Alberti Excel Programming 1 October 30th 03 01:00 PM
Record Worksheet Content as Macro and Execute from another Worksheet David McRitchie[_2_] Excel Programming 2 July 23rd 03 09:43 AM


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

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

About Us

"It's about Microsoft Excel"