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 Protecting worksheet within an Macro


Hello. Boy, do I need help....

I had to unprotect and protect a worksheet within a macro to get some
code to run. Problem: The protection variables that I originally
assigned when I manually protected the sheet (and before the macro was
run for the first time), such as allow the user to format unlocked
cells, columns, and rows is modified. Is there a way to keep these
protection variables in tact with the macro code?? I'm running excel
2003, but some users will be running 2000.

Worksheets("DOLLARS").Unprotect Password:="HAPPY"
Range("U9:AF9").Select
Selection.EntireColumn.Hidden = True
Range("AG10:AN10").Select
Selection.EntireColumn.Hidden = False
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 1
Range("B13").Select
Worksheets("DOLLARS").Protect Password:="HAPPY"
End Sub

I appreciate any input.


--
Thor
------------------------------------------------------------------------
Thor's Profile: http://www.excelforum.com/member.php...fo&userid=1049
View this thread: http://www.excelforum.com/showthread...hreadid=499160

 
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
Protecting worksheet Patricia Excel Discussion (Misc queries) 1 March 15th 10 02:49 PM
Protecting worksheet Kimti Excel Worksheet Functions 1 July 6th 08 01:37 AM
hiding macro codes upon protecting the worksheet eehj23 Excel Discussion (Misc queries) 1 April 28th 06 03:55 AM
Macro problem with protecting worksheet........... PKyle Excel Programming 9 August 2nd 04 04:24 PM
Protecting worksheet Shilps Excel Programming 2 April 27th 04 01:01 PM


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