ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Manipulating Ranges Alphabetically, and Deleting Blank Entries (https://www.excelbanter.com/excel-programming/386120-manipulating-ranges-alphabetically-deleting-blank-entries.html)

Dustin

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?




Thanks


Susan

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
when you sort it, the blanks will automatically go to the bottom of
whatever column it is sorting from.
do you want to sort it programmatically, or just in excel?
if in excel, highlight the range & choose "Data" "Sort".
susan



On Mar 27, 10:28 am, "Dustin" wrote:
I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?

Thanks




Susan

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
& if you want to do it automatically, then turn on the macro recorder,
sort the data, stop the macro recorder, and see how it did it.
susan

On Mar 27, 10:28 am, "Dustin" wrote:
I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?

Thanks




Dustin

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
On Mar 27, 9:39 am, "Susan" wrote:
& if you want to do it automatically, then turn on the macro recorder,
sort the data, stop the macro recorder, and see how it did it.
susan

On Mar 27, 10:28 am, "Dustin" wrote:

I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?


Thanks


Ok Thanks


Dustin

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
On Mar 27, 9:58 am, "Dustin" wrote:
On Mar 27, 9:39 am, "Susan" wrote:

& if you want to do it automatically, then turn on the macro recorder,
sort the data, stop the macro recorder, and see how it did it.
susan


On Mar 27, 10:28 am, "Dustin" wrote:


I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?


Thanks


Ok Thanks


Can you give me an example to use the sort command after the following
code

'Collects Owners into range
Dim Owners As Range
Dim OwnerCell As Range

Set Owners = exApp.Range("B:B").SpecialCells(xlCellTypeConstant s)
For Each OwnerCell In Owners
Next OwnerCell

Owners.Sort (What do I do from here?)


Thanks


Susan

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
here's a link to a thread that explains "sort" pretty well.........
http://groups.google.com/group/micro...3e326ab ad23e

Selection.Sort Key1:=Range("B1"), Order1:=xlAscending,
header:=xlGuess,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
DataOption1:=xlSortNormal

these are all the parameters for "sort".
you don't need the "for each - next" construct because
you're going to select (or indicate) the whole range
and then sort THAT. you can't sort individual cells because
you have nothing to sort them against.

Set Owners = exApp.Range("B:B").SpecialCells(xlCellTypeConstant s)
owners.sort blah blah blah

hope this helps
susan



On Mar 27, 11:08 am, "Dustin" wrote:
On Mar 27, 9:58 am, "Dustin" wrote:

On Mar 27, 9:39 am, "Susan" wrote:


& if you want to do it automatically, then turn on the macro recorder,
sort the data, stop the macro recorder, and see how it did it.
susan


On Mar 27, 10:28 am, "Dustin" wrote:


I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?


Thanks


Ok Thanks


Can you give me an example to use the sort command after the following
code

'Collects Owners into range
Dim Owners As Range
Dim OwnerCell As Range

Set Owners = exApp.Range("B:B").SpecialCells(xlCellTypeConstant s)
For Each OwnerCell In Owners
Next OwnerCell

Owners.Sort (What do I do from here?)

Thanks




Tom Ogilvy

Manipulating Ranges Alphabetically, and Deleting Blank Entries
 
If you sort it in alphabetical order, don't all the blanks sort to the bottom?

Seems like that would be equivalent to deleting them

Or you can do

columns(1).SpecialCells(xlBlanks).EntireRow.Delet

of course they may not really be blanks, but are cells that look blank.
that would be different.

--
Regards,
Tom Ogilvy


"Dustin" wrote:

I was wondering if it is possible to sort a range in
alphabetical order, and delete any blank entries?




Thanks




All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com