Sub Macro1()
Dim comment As String
comment = InputBox("Enter Sort Password")
If comment <> "12345" Then
MsgBox ("Invalid Password")
Exit Sub
End If
ActiveSheet.Unprotect Password:="55555"
Columns("A:E").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect Password:="55555"
End Sub
Sort Password is set as 12345, Activesheet Password is set as 55555
It's selecting Columns A:E and sorting by Column A
Customize as you need to
Bookmarks