Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Method Questions
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need really fast method to sort data for my part numbering spread | Excel Discussion (Misc queries) | |||
VBA Sort method w/more than 3 Keys | Excel Discussion (Misc queries) | |||
To sort data in VBA/excel by the method of the minimas | Excel Programming | |||
sort method frustration | Excel Programming | |||
Sort method of range | Excel Programming |