Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Unlocking and Locking in a Marco

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Unlocking and Locking in a Marco

try this
worksheets("Sheet1").unprotect "password"
'run your code here
worksheets("Sheet1").protect "password"

"JBoyer" wrote:

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Unlocking and Locking in a Marco

That's all I needed. THANKS!

"Mike" wrote:

try this
worksheets("Sheet1").unprotect "password"
'run your code here
worksheets("Sheet1").protect "password"

"JBoyer" wrote:

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Unlocking and Locking in a Marco

Your welcome

"JBoyer" wrote:

That's all I needed. THANKS!

"Mike" wrote:

try this
worksheets("Sheet1").unprotect "password"
'run your code here
worksheets("Sheet1").protect "password"

"JBoyer" wrote:

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!

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
locking and unlocking worksheets adam Excel Worksheet Functions 6 October 31st 07 05:31 PM
Locking/Unlocking cells upon condition Brettjg Excel Discussion (Misc queries) 20 March 12th 07 06:01 AM
Locking/Unlocking sheets using a range. wilro85[_23_] Excel Programming 5 August 17th 06 10:50 PM
Locking and unlocking a workbook Nigel Bennett Excel Programming 1 June 21st 04 03:58 PM
Locking/unlocking cells Ian Coates Excel Programming 1 February 3rd 04 04:04 PM


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