ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sorting protected sheets (https://www.excelbanter.com/excel-worksheet-functions/111256-sorting-protected-sheets.html)

esslingerdav

sorting protected sheets
 
I have a worksheet that has a column of locked cells but all the rest are
unlocked. I want all the locked cells protected to keep multiple users from
messing up formulas. Is there a way to sort this sheet after it is
protected? I am having to unprotect the sheet everytime I want to resort the
data. thanks!


kassie

sorting protected sheets
 
You can use a macro to do this for you

Sub Sorter()
ActiveSheet.Unprotect
'You can specify a password to use for the unprotection
Range("insert your range").Select
Selection.Sort Key1:=Range("mayebe the first cell of the range, else the
column you want to sort by"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True 'You can also add a password here
End Sub


"esslingerdav" wrote:

I have a worksheet that has a column of locked cells but all the rest are
unlocked. I want all the locked cells protected to keep multiple users from
messing up formulas. Is there a way to sort this sheet after it is
protected? I am having to unprotect the sheet everytime I want to resort the
data. thanks!



All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com