Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Running Macros in a protected workbook

Hi,

I have just started to use macros in Excel worksheets at a basic level, I am
recording the macro using "key strokes" rather than righting the code. (This
I have yet to master)

My problem is that I have a workbook containing several sheets which contain
columns of data that I want to lock. However when the sheets are locked and
the macro run it generates errors. I have read through articles on
unprotecting the sheet but when I try to write these codes into VBA the macro
still doesn't work.

Can anyone give me a simple idiots guide answer

Many thanks

Rob
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Running Macros in a protected workbook

Hi Rob

First unprotect the sheet, then your code to manipulate the sheet. Finally,
protect the sheet again.

Worksheets("YourSheet").UnProtect Password:="JustMe"

and

Worksheets("YourSheet").Protect Password:="JustMe"

Hopes this helps.
....
Per


"Christian" skrev i meddelelsen
...
Hi,

I have just started to use macros in Excel worksheets at a basic level, I
am
recording the macro using "key strokes" rather than righting the code.
(This
I have yet to master)

My problem is that I have a workbook containing several sheets which
contain
columns of data that I want to lock. However when the sheets are locked
and
the macro run it generates errors. I have read through articles on
unprotecting the sheet but when I try to write these codes into VBA the
macro
still doesn't work.

Can anyone give me a simple idiots guide answer

Many thanks

Rob


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
Running VB macros gwtechie72 New Users to Excel 2 November 12th 07 10:04 PM
Running Macros Links and Linking in Excel 3 July 13th 06 11:30 PM
Running Macros Excel Discussion (Misc queries) 1 July 6th 06 04:21 PM
Running Macros when on the LAN Bettergains Excel Discussion (Misc queries) 0 October 6th 05 09:38 PM
Running Macros in protected workbook petunia Excel Worksheet Functions 3 January 18th 05 09:24 PM


All times are GMT +1. The time now is 04: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"