Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Protection Macros--modify to allow format changes

Hello. I am currently using the following macro:

Option Explicit
Sub UnprotectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.unprotect password:="topsecret"
next wks
End Sub
Sub ProtectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.protect password:="topsecret"
next wks
End Sub

I would like to be able to modify this macro so that end users can format
rows as needed. I am a beginnner macro user. Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Protection Macros--modify to allow format changes

Sub ProtectAll()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:="topsecret", AllowFormattingRows:=True
Next wks
End Sub

To see all arguments enter wks.Protect, and Intellisense will show you all
the options.


Gord Dibben MS Excel MVP

On Thu, 11 Feb 2010 11:00:13 -0800, Visakha
wrote:

Hello. I am currently using the following macro:

Option Explicit
Sub UnprotectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.unprotect password:="topsecret"
next wks
End Sub
Sub ProtectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.protect password:="topsecret"
next wks
End Sub

I would like to be able to modify this macro so that end users can format
rows as needed. I am a beginnner macro user. Thanks in advance!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Protection Macros--modify to allow format changes

THANKS! This was very helpful!!

"Gord Dibben" wrote:

Sub ProtectAll()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:="topsecret", AllowFormattingRows:=True
Next wks
End Sub

To see all arguments enter wks.Protect, and Intellisense will show you all
the options.


Gord Dibben MS Excel MVP

On Thu, 11 Feb 2010 11:00:13 -0800, Visakha
wrote:

Hello. I am currently using the following macro:

Option Explicit
Sub UnprotectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.unprotect password:="topsecret"
next wks
End Sub
Sub ProtectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.protect password:="topsecret"
next wks
End Sub

I would like to be able to modify this macro so that end users can format
rows as needed. I am a beginnner macro user. Thanks in advance!


.

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
Modify general format to date format. SherryS Excel Worksheet Functions 2 April 27th 10 01:34 PM
Unable to modify the level of protection of macro c-p Excel Discussion (Misc queries) 4 July 10th 07 02:30 AM
Modify Web Query using macros? SPYREN Excel Programming 2 October 11th 04 03:37 PM
protection and macros Sam Excel Programming 3 June 19th 04 08:10 PM
Protection & Macros Catherine[_5_] Excel Programming 6 June 12th 04 12:24 PM


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