Macro is giving me problems with sorting

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.
 
M

Myrna Larson

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.
 
M

Mark Bigelow

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!
 
C

Charlene Dallos

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top