Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a worksheet that has a fixed area cells a8:n40 this area will not be
filled and will contain blank rows. i am doing a sort in ascending order first and then i want to select the rows that contain data and not blank rows to do a second sort in descending order. Here is what i have already for the second sort and it will error when placed in operation. this first line works worksheets("HD").Range("A8:n40").Sort Key1:=Worksheets("HD").Range("m8"), Order1:=xlAscending 'xlAscending xlDescending from this point it will not select the data and errors out Dim LastRow As Integer 'This is the LAST Non Empty Row LastRow = Worksheets("HD").UsedRange.Row - 1 + _ Worksheets("HD").UsedRange.Rows.Count Worksheets("HD").Range("A8:0" & LastRow & ").Sort Key1:=Worksheets("HD").Range("m8"), Order1:=xlDescending 'xlAscending xlDescending |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select rows and sort based on type | Excel Discussion (Misc queries) | |||
sorting more than 3 keys | Excel Discussion (Misc queries) | |||
sort by section number | Excel Discussion (Misc queries) | |||
"-" ignored in sort | Excel Discussion (Misc queries) | |||
HELP! How do you--> Lock a set of rows but also link worksheets to | Excel Discussion (Misc queries) |