Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a new worksheet with a macro and giving it a specific name Steve Krieger Excel Discussion (Misc queries) 2 May 27th 09 10:18 PM
Vlookup: giving me REF# problems. Help Dave Excel Discussion (Misc queries) 2 December 4th 08 07:30 PM
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
Macro giving errors at workbook open kcdonaldson Excel Discussion (Misc queries) 1 December 6th 05 04:15 PM
3 problems giving me grief. Any help appreciated. Jan Karel Pieterse Excel Programming 0 July 21st 03 11:31 AM


All times are GMT +1. The time now is 10:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"