Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
I tried looking through Google but to no avail. I'm
trying to automatically sort a range of data containing two columns using VBA not the sort under DataSort. The cell I'm want to sort on is text (company names) and is a formula based on information on another worksheet. My dilema is that when I sort this way ..Range("a34:b202").Sort Key1:=.Range("a34"), Order1:=xlAscending the results come out alphabetically but if there are blank cells between the last company and A202 the blanks are at the beginning and I need them at the bottom. Is there a way to sort with putting the blanks at the end? Could I maybe add INDEX or something to the formula to have it do it? the fomula I use is: {=IF(ISNA(INDEX('Priced BOM'!$W$3:$W$1010,MATCH(0,COUNTIF ($A$33:A33,'Priced BOM'!$W$3:$W$1010),0))),"",INDEX ('Priced BOM'!$W$3:$W$1010,MATCH(0,COUNTIF ($A$33:A33,'Priced BOM'!$W$3:$W$1010),0)))} Thanks for all your help Joe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
I might consider putting "zzzzzzzzzzzzzzzz"s (or other useful but unique
values) in the blank cells programatically, sort, then remove the "zzzzzzzzzzzzzzzzzz"s using a replace the "zzz...." with a null string. Or use a helper column filled with formulas and/or values that better represents the sort I want, sort on the helper column, then drop it. "Joe Gieder" wrote in message ... I tried looking through Google but to no avail. I'm trying to automatically sort a range of data containing two columns using VBA not the sort under DataSort. The cell I'm want to sort on is text (company names) and is a formula based on information on another worksheet. My dilema is that when I sort this way .Range("a34:b202").Sort Key1:=.Range("a34"), Order1:=xlAscending the results come out alphabetically but if there are blank cells between the last company and A202 the blanks are at the beginning and I need them at the bottom. Is there a way to sort with putting the blanks at the end? Could I maybe add INDEX or something to the formula to have it do it? the fomula I use is: {=IF(ISNA(INDEX('Priced BOM'!$W$3:$W$1010,MATCH(0,COUNTIF ($A$33:A33,'Priced BOM'!$W$3:$W$1010),0))),"",INDEX ('Priced BOM'!$W$3:$W$1010,MATCH(0,COUNTIF ($A$33:A33,'Priced BOM'!$W$3:$W$1010),0)))} Thanks for all your help Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Values Without Sorting Formulas | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Sorting VLookup vs Sorting SumProduct | Excel Discussion (Misc queries) | |||
Sorting: Sorting by the First Character | Excel Discussion (Misc queries) | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |