macro for sorting in protected sheet
excel 2000 so no luck for that.
"Billy Liddel" wrote:
Hi
In Xl2003 you can set the protection in unlocked cells to allow the user to
sort - so a macro will not be needed.
Peter
"vcff" wrote:
Hi all
I created a button in a protected worksheet to allow sorting of data in
column A6 to A60 which does not work. Pls help.
I used the following code which I found in the discussion group. What I need
is to sort only a range of datas in one column, eg A6 to A60
Sub sortit()
Dim coltosort As Range
Set coltosort = Application.InputBox(Prompt:= _
"Select A Column", Type:=8)
ActiveSheet.Unprotect Password:="justme"
ActiveSheet.UsedRange.Sort Key1:=coltosort.Cells(2), _
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
With ActiveSheet
..Protect Password:="justme"
..EnableSelection = xlNoRestrictions
End With
End Sub
|