ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Last Row or Empty Row in VBA (https://www.excelbanter.com/excel-programming/324811-find-last-row-empty-row-vba.html)

Kahuna

Find Last Row or Empty Row in VBA
 
Hi Folks

I have a sheet that I generate and save using automation from Access, and it
works OK. Problem is I cant add to the previously made sheet. I need to be
able to find the last row with data in the sheet (for a specific column) or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------



david mcritchie

Find Last Row or Empty Row in VBA
 
Hi Kahuna,

Sub GotoBottomOfCurrentColumn()
'Tom Ogilvy 2000-06-26
Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
End Sub

since you want the next row
Cells(Rows.Count,ActiveCell.Column).End(xlUp).offs et(1,0).Select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Kahuna" wrote in message ...
Hi Folks

I have a sheet that I generate and save using automation from Access, and it
works OK. Problem is I cant add to the previously made sheet. I need to be
able to find the last row with data in the sheet (for a specific column) or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------





Kahuna

Find Last Row or Empty Row in VBA
 
Spot on David - thanks for the quick response. Exactly what I needed.

--
Kahuna
------------
"David McRitchie" wrote in message
...
Hi Kahuna,

Sub GotoBottomOfCurrentColumn()
'Tom Ogilvy 2000-06-26
Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
End Sub

since you want the next row
Cells(Rows.Count,ActiveCell.Column).End(xlUp).offs et(1,0).Select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Kahuna" wrote in message
...
Hi Folks

I have a sheet that I generate and save using automation from Access, and
it
works OK. Problem is I cant add to the previously made sheet. I need to
be
able to find the last row with data in the sheet (for a specific column)
or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------








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

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