Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do not see how it would sort by column B with this code, also there is no
need to select the range, you could do it like this Range("A4:AY298").Sort Key1:=Range("A4"), _ Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, DataOption1:=xlSortNormal -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "hotherps" wrote in message ... 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").Select -- hotherps ------------------------------------------------------------------------ hotherps's Profile: http://www.excelforum.com/member.php...fo&userid=5055 View this thread: http://www.excelforum.com/showthread...hreadid=320053 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I protect a number of sheets allowing the user to add a com | New Users to Excel | |||
password protect sheets | Excel Worksheet Functions | |||
Protect Excel sheets with Password Using VBA | Excel Programming | |||
Protecting Multiple sheets with prompt for password to unprotect | Excel Programming |