This is the code that locks the workbook
Dim Sht As Worksheet
Const Pass As String = "hello"
On Error Resume Next
For Each Sht In ThisWorkbook.Worksheets
With Sht
.cells.Locked = False
.cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect UserInterfaceOnly:=True, Password:=Pass
End With
Next Sht
This is the sort code
Range("A4:AY298").Select
Selection.SORT Key1:=Range("A4"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNormal
Range("A4").Selec
--
hotherp
-----------------------------------------------------------------------
hotherps's Profile:
http://www.excelforum.com/member.php...nfo&userid=505
View this thread:
http://www.excelforum.com/showthread.php?threadid=32005