Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Husker87
 
Posts: n/a
Default How can I run a macro in a protected worksheet?

I have a worksheet which I want users to enter a limited amount of
information and then I have a a couple of macros that sorts it for them. How
can I run the macro and still protect the worksheet? Any ideas?
  #2   Report Post  
Kassie
 
Posts: n/a
Default

You cannot run a sort macro in a protected sheet, so you have to unprotect,
do the sort, and protect the sheet again. In a similar post, Julie D posted
the following:

Hi

you'll need to uprotect the sheet at the start of the macro and protect it
again at the end
e.g.

sub mymacro()

activesheet.unprotect ("pwd")
'current code

activesheet.protect ("pwd")
end sub

where pwd is your password

Cheers
JulieD

"Husker87" wrote:

I have a worksheet which I want users to enter a limited amount of
information and then I have a a couple of macros that sorts it for them. How
can I run the macro and still protect the worksheet? Any ideas?

  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Husker

The easiest method is to unprotect, run your code then re-protect.

Sub Sort_and_stuff()
ActiveSheet.Unprotect Password:="justme"

'do your things or call your macros here

ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub


Gord Dibben Excel MVP

On Wed, 30 Mar 2005 10:41:06 -0800, "Husker87"
wrote:

I have a worksheet which I want users to enter a limited amount of
information and then I have a a couple of macros that sorts it for them. How
can I run the macro and still protect the worksheet? Any ideas?


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
Question about sorting in protected worksheet SJC Excel Worksheet Functions 6 March 24th 05 10:35 PM
Protected Worksheet Kevin New Users to Excel 2 February 9th 05 11:13 PM
Sorting protected worksheet Phyllis Excel Discussion (Misc queries) 3 December 15th 04 11:27 PM
Executing macro for all worksheet from a different worksheet Biti New Users to Excel 3 December 8th 04 10:05 AM
How use group and ungroup functions while worksheet is protected Gabriel De la Garza Excel Worksheet Functions 1 November 17th 04 01:44 AM


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