Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want a commandbutton to sort A3:Q. Though column Q is included in the
range, the cells in column Q may be empty. Therefore, I need to locate the last row using column A, then sort A3:Q(lastrow). Here is the code I was working with: Private Sub CommandButton3_Click() Lastrow = Range("A65536").End(xlUp).Select Range("A3:Q" & Lastrow).Select Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("B3") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom End Sub Thanks for your help! Les |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Excel Sorting - Finding Duplicate Entries | Excel Programming | |||
finding, sorting, put only part of a cell | Excel Worksheet Functions | |||
Finding Duplicates in a Column (Without Sorting) | Excel Discussion (Misc queries) | |||
Sorting and Finding data | Excel Discussion (Misc queries) |