Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Sort protected sheet

I have a sheet which has pasted links from another sheet but
consolidates the information, I can sort this information if the sheet
is unprotected, but not if it is protected. I really need to protect
the sheet to stop inadvertently overwriting the pasted link.
I think I can do this by having the Macro unprotect, do the sort and
then reprotect. Is there a way of doing this easier? and is there a
way of stoping anyone of reading a macro which at times is as
important as protecting the data it points to. Thanks EPJ
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Sort protected sheet

just an example.
this protects the sheet, but allows code to run while it's protected.
in the thisworkbook module you could have something like this:

Private Sub Workbook_Open()
Worksheets("Sheet1").Protect UserInterfaceOnly:=True
End Sub

then you could have your sort code like this:

Sub sort()
With Worksheets("Sheet1").Range("A1:C10")
.Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub


or you could just protect the sheet, then unprotect iwith code, run your sort
code and then protect it again.

--


Gary


wrote in message
...
I have a sheet which has pasted links from another sheet but
consolidates the information, I can sort this information if the sheet
is unprotected, but not if it is protected. I really need to protect
the sheet to stop inadvertently overwriting the pasted link.
I think I can do this by having the Macro unprotect, do the sort and
then reprotect. Is there a way of doing this easier? and is there a
way of stoping anyone of reading a macro which at times is as
important as protecting the data it points to. Thanks EPJ



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
Allow sort of Protected Sheet TraciAnn via OfficeKB.com Excel Discussion (Misc queries) 2 May 21st 09 03:35 PM
How to - sort a protected sheet? Bob Excel Worksheet Functions 0 December 26th 08 04:34 PM
Sort Protected Sheet Erika Excel Discussion (Misc queries) 2 December 10th 08 07:45 PM
can i sort a protected sheet sindu Excel Discussion (Misc queries) 1 June 17th 05 08:07 PM
Sort on a protected sheet mac Excel Worksheet Functions 1 April 27th 05 06:19 PM


All times are GMT +1. The time now is 12:23 AM.

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"