Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Allow sort of Protected Sheet | Excel Discussion (Misc queries) | |||
How to - sort a protected sheet? | Excel Worksheet Functions | |||
Sort Protected Sheet | Excel Discussion (Misc queries) | |||
can i sort a protected sheet | Excel Discussion (Misc queries) | |||
Sort on a protected sheet | Excel Worksheet Functions |