ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last row with data in a column (https://www.excelbanter.com/excel-programming/354155-last-row-data-column.html)

fullers

Last row with data in a column
 
I am trying to improve my macro.

At the moment I have data in column A. It always starts in cell A1 and I
need to find the last row with data. At the moment I have the following code:

Cells(1, 1).Select
Selection.End(xlDown).Select
EndCell = ActiveCell.Row

I am trying to get away from actually selecting cells in a sheet if I can.
Is there some code that will find the last row for me?

Thanks in advance.

Don Guillett

Last row with data in a column
 
lastcell=cells(rows.count,1).end(xlup).row

--
Don Guillett
SalesAid Software

"fullers" wrote in message
...
I am trying to improve my macro.

At the moment I have data in column A. It always starts in cell A1 and I
need to find the last row with data. At the moment I have the following
code:

Cells(1, 1).Select
Selection.End(xlDown).Select
EndCell = ActiveCell.Row

I am trying to get away from actually selecting cells in a sheet if I can.
Is there some code that will find the last row for me?

Thanks in advance.




fullers

Last row with data in a column
 
Thanks very much Don.

"Don Guillett" wrote:

lastcell=cells(rows.count,1).end(xlup).row

--
Don Guillett
SalesAid Software

"fullers" wrote in message
...
I am trying to improve my macro.

At the moment I have data in column A. It always starts in cell A1 and I
need to find the last row with data. At the moment I have the following
code:

Cells(1, 1).Select
Selection.End(xlDown).Select
EndCell = ActiveCell.Row

I am trying to get away from actually selecting cells in a sheet if I can.
Is there some code that will find the last row for me?

Thanks in advance.





Don Guillett

Last row with data in a column
 
glad to help

--
Don Guillett
SalesAid Software

"fullers" wrote in message
...
Thanks very much Don.

"Don Guillett" wrote:

lastcell=cells(rows.count,1).end(xlup).row

--
Don Guillett
SalesAid Software

"fullers" wrote in message
...
I am trying to improve my macro.

At the moment I have data in column A. It always starts in cell A1 and
I
need to find the last row with data. At the moment I have the following
code:

Cells(1, 1).Select
Selection.End(xlDown).Select
EndCell = ActiveCell.Row

I am trying to get away from actually selecting cells in a sheet if I
can.
Is there some code that will find the last row for me?

Thanks in advance.








All times are GMT +1. The time now is 07:37 PM.

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