Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro is giving me problems with sorting
In the sort command, for the header argument,
do you have header:=xlguess in your macro. Change it to header:=xlno This assumes you don't have headers. -- Regards, Tom Ogilvy "Charlene Dallos" wrote in message ... I am currently creating a database for my company and when I record my macros and create my VB code and implement them into my command buttons, It will sort everything except my top row. There are nine columns in my database, it's about 100 rows long and my first two columns will sort just fine, but when I click on my third, forth, fifth etc. all the rows will sort except the very first one. I messed around with it for hours and I know it's probably something very easily fixable. Please Help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro is giving me problems with sorting
Excel probably is "thinking" the first row is a header. Your code should include the argument to
explicitly "tell" Excel whether there are headers or not. Check Help for more information. On Tue, 2 Sep 2003 14:23:06 -0400, "Charlene Dallos" wrote: I am currently creating a database for my company and when I record my macros and create my VB code and implement them into my command buttons, It will sort everything except my top row. There are nine columns in my database, it's about 100 rows long and my first two columns will sort just fine, but when I click on my third, forth, fifth etc. all the rows will sort except the very first one. I messed around with it for hours and I know it's probably something very easily fixable. Please Help! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro is giving me problems with sorting
Make sure you have the following Header part in your sort code:
Range("A:A").Sort Key1:=Range("A1"), Header:=xlNo This tells Excel that the first line is not a header and to go ahead and sort it. Let me know if that doesn't work. Mark --- Mark Bigelow mjbigelow at hotmail dot com http://hm.imperialoiltx.com *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro is giving me problems with sorting
I am currently creating a database for my company and when I record my
macros and create my VB code and implement them into my command buttons, It will sort everything except my top row. There are nine columns in my database, it's about 100 rows long and my first two columns will sort just fine, but when I click on my third, forth, fifth etc. all the rows will sort except the very first one. I messed around with it for hours and I know it's probably something very easily fixable. Please Help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create a new worksheet with a macro and giving it a specific name | Excel Discussion (Misc queries) | |||
Vlookup: giving me REF# problems. Help | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Macro giving errors at workbook open | Excel Discussion (Misc queries) | |||
3 problems giving me grief. Any help appreciated. | Excel Programming |