Macro is giving me problems with sorting

  • Thread starter Thread starter Tom Ogilvy
  • Start date Start date
T

Tom Ogilvy

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.
 
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.
 
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
 
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!
 
Back
Top