Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am doing serveral sorts in a macro. The code was recorded. When I run the
macro it always states that it can not determine which row in my list contains column labels. I have to then click OK for it to assume that I want the first row to be what it sorts by. It there a way around this? -- Regards, Michael |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Michael This is some code that I use in one of my projects, it does an alpha sort. Shd = Sheets("Data") Shd.Range("B5:AZ40").Sort Key1:=Shd.Range("B5"), Order1:=xlAscending HTH Andrew Bourke Michael from Austin wrote: I am doing serveral sorts in a macro. The code was recorded. When I run the macro it always states that it can not determine which row in my list contains column labels. I have to then click OK for it to assume that I want the first row to be what it sorts by. It there a way around this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My mistake it is not happening for the sort, it is happening when I am going
to subtotal. The message that is..... "Ajtb" wrote: Hi Michael This is some code that I use in one of my projects, it does an alpha sort. Shd = Sheets("Data") Shd.Range("B5:AZ40").Sort Key1:=Shd.Range("B5"), Order1:=xlAscending HTH Andrew Bourke Michael from Austin wrote: I am doing serveral sorts in a macro. The code was recorded. When I run the macro it always states that it can not determine which row in my list contains column labels. I have to then click OK for it to assume that I want the first row to be what it sorts by. It there a way around this? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dunno if this will help, but you may want to re-record the macro and
this time in the sort dialog box ensure you select the 'my data range has header row' option. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I am doing serveral sorts in a macro. The code was recorded. When I run the macro it always states that it can not determine which row in my list contains column labels. I have to then click OK for it to assume that I want the first row to be what it sorts by. It there a way around this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting Values Without Sorting Formulas | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Sorting VLookup vs Sorting SumProduct | Excel Discussion (Misc queries) | |||
Sorting: Sorting by the First Character | Excel Discussion (Misc queries) | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |