ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get rid of empty rows (https://www.excelbanter.com/excel-programming/285090-get-rid-empty-rows.html)

mike

Get rid of empty rows
 
Hi. I am using the following line to select a range from
the active cell down to the last cell in the file. My
problem is that I want this to go to the last cell THAT
HAS DATA. There are several rows below this last cell
that are somehow recognized as being part of the range.
Is there either a way to delete the rows or to instruct
the macro to go to the last cell with data?

Range(Selection, ActiveCell.SpecialCells
(xlLastCell)).Select

Thanks,
Mike.
..



Colo[_11_]

Get rid of empty rows
 
Hi Mike,

Try like this! ;)


Code:
--------------------

With ActiveCell
Range(.Item(1), .Parent.Cells.Find("*", , , , 1, 2)).Select
End With

--------------------



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


mike

Get rid of empty rows
 
Thanks! It works great.

Mike.
-----Original Message-----
Hi Mike,

Try like this! ;)


Code:
--------------------

With ActiveCell
Range(.Item(1), .Parent.Cells.Find("*", , , , 1,

2)).Select
End With

--------------------



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

.



All times are GMT +1. The time now is 08:53 AM.

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