LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default protect / unprotect worksheets using VBA

My workbook includes several worksheets. I'm using the following code
to unprotect and then protect the contents of these worksheets as I
write to them.

DatabaseWorksheet.Unprotect Password:=DwgNumLogPwd
InputFormWorksheet.Select
DatabaseWorksheet.Cells(DestinationRow, 1).Value = AssignDate
DatabaseWorksheet.Protect Password:=DwgNumLogPwd

This code is executed when InputFormWorksheet is the active worksheet.
Thus there is a toggling back and forth between worksheets.

Does anyone know of a cleaner way to protect worksheets? Bear in mind
the worksheets being protected need to remain visible.

Thanks.

Kevin



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
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
Protect and Unprotect all worksheets with macro Joe M. Excel Discussion (Misc queries) 2 January 22nd 10 09:26 PM
ToggleButton to Unprotect/Protect all worksheets Kellascat Excel Discussion (Misc queries) 0 November 9th 09 07:30 PM
Protect/Unprotect Multiple Worksheets Katherine R Excel Discussion (Misc queries) 2 May 9th 06 04:07 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
Macro to protect/unprotect worksheets Cameron[_3_] Excel Programming 2 August 6th 03 10:31 PM


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