ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete blanks (https://www.excelbanter.com/excel-programming/297485-delete-blanks.html)

Dennis

delete blanks
 
Hello

I have a series of ranges, eg a1:a10
This range contains words in some cells and numbers in
others.
I successfully replace all certain words with "" and sort
the range using A1 as the key.
However, after it's been sorted there are a number of
blank cells at the top.
Since I will be using this range to load a combobox I'd
like to shift the whole lot up and remove the blank spaces
at the top.

Any ideas?

kkknie[_84_]

delete blanks
 
If you are doing this in code, the easiest way would be to do you
replacement of the certain words with "" and then put this line in th
code before doing the sort.

Range("A1:A10").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete

Replacing the A1:A10 with your range. The line above essientiall
deletes the entire row of anything with a blank cell in the A1:A1
range.



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



All times are GMT +1. The time now is 02:05 PM.

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