Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort Method Questions

Hello,
Tom Ogilvy recently posted some instructions on how to sort
information in a spreadsheet with VBA. Since then I’ve done some
research and I have a few questions. VBA Help gives the following
example:

This example sorts the region that contains cell A1 (the active region)
on Sheet1, sorting by the data in the first column and automatically
using a header row if one exists. The Sort method determines the active
region automatically.
Worksheets("Sheet1").Range("A1").Sort _
Key1:=Worksheets("Sheet1").Columns("A"), _
Header:=xlGuess

My questions a
1) How does the sort method determine the active region automatically?
Are there any circumstances under which it is not reliable?
2) What criteria does it use in determining whether or not there is a
header? Is that reliable?
3) What other options are there besides xlGuess, which makes me
uneasy?

Thanks in advance for all your help. - Pikus


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort Method Questions

click in your data and do Ctrl+Shift+8

it expands out to the first completely blank column/row or the edge of the
sheet. If you have date that contains blank rows or columns, then it is
unreliable.

It determines if there is a header by seeing if the first row is different
from the remainder of the data - so it is a guess. I know making it bold is
pretty reliable.

Besides xlguess, you can tell it xlYes or xlNo

--
Regards,
Tom Ogilvy

"pikus " wrote in message
...
Hello,
Tom Ogilvy recently posted some instructions on how to sort
information in a spreadsheet with VBA. Since then I've done some
research and I have a few questions. VBA Help gives the following
example:

This example sorts the region that contains cell A1 (the active region)
on Sheet1, sorting by the data in the first column and automatically
using a header row if one exists. The Sort method determines the active
region automatically.
Worksheets("Sheet1").Range("A1").Sort _
Key1:=Worksheets("Sheet1").Columns("A"), _
Header:=xlGuess

My questions a
1) How does the sort method determine the active region automatically?
Are there any circumstances under which it is not reliable?
2) What criteria does it use in determining whether or not there is a
header? Is that reliable?
3) What other options are there besides xlGuess, which makes me
uneasy?

Thanks in advance for all your help. - Pikus


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort Method Questions

Sweet! Thanks! - Pikus


---
Message posted from http://www.ExcelForum.com/

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
Need really fast method to sort data for my part numbering spread Chris Dundorf Excel Discussion (Misc queries) 7 March 24th 10 06:05 PM
VBA Sort method w/more than 3 Keys KenRoy Excel Discussion (Misc queries) 1 August 26th 05 10:48 PM
To sort data in VBA/excel by the method of the minimas Jean-mi Excel Programming 1 December 11th 03 09:26 AM
sort method frustration David Wenham Excel Programming 2 August 21st 03 06:26 PM
Sort method of range Richard Clarke Excel Programming 7 July 25th 03 04:42 PM


All times are GMT +1. The time now is 01:31 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"