Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the sort key must be defined in context as well.
Sheets(2).Range(Cells(1, 2), Cells(12, 2)).Sort Key1:=Sheet(2).Cells(1, 2) or With Sheet(2) .Range(Cells(1,2),Cells(12,2)).Sort Key1:=.Cells(1,2) End With -- Cheers Nigel "SystemHack" wrote in message ... Ok I can get this to work on the same page but not on a different sheet. This is the code I am trying to use. Private Sub CommandButton1_Click() Sheets(2).Range(Cells(1, 2), Cells(12, 2)).Sort Key1:=Cells(1, 2) End Sub Any ideas why this wouldn't work ? -- SystemHack ------------------------------------------------------------------------ SystemHack's Profile: http://www.excelforum.com/member.php...o&userid=26614 View this thread: http://www.excelforum.com/showthread...hreadid=399388 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sorting range | Excel Discussion (Misc queries) | |||
sorting range | Excel Discussion (Misc queries) | |||
Sorting by range | New Users to Excel | |||
Sorting a Range | Excel Discussion (Misc queries) | |||
sorting a range | Excel Discussion (Misc queries) |