![]() |
Finding the last row entered
Hello from Steved
Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. |
Hi Steved
You can use this to select the next empty cell Sub test() Range("A" & Rows.Count).End(xlUp)(2).Select End Sub This will select the last cell with data Range("A" & Rows.Count).End(xlUp).Select -- Regards Ron de Bruin http://www.rondebruin.nl "Steved" wrote in message ... Hello from Steved Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. |
Assuming the data's in sheet1, this will return the next empty cell in
column A ThisWorkbook.Sheets("Sheet1").Range("A65536").End( xlUp).Offset(1, 0) HTH Alan P. "Steved" wrote in message ... Hello from Steved Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. |
Steve
' note that NextRow will be 2 if no data is present Dim NextRow As Long NextRow = Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row MsgBox NextRow Regards Trevor "Steved" wrote in message ... Hello from Steved Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. |
Sub LastCell()
Dim LastCellRow As Long Dim FirstOpenRow As Long LastCellRow = Cells(Rows.Count, "A").End(xlUp).Row FirstOpenRow = LastCellRow + 1 MsgBox FirstOpenRow End Sub --- HTH Jason Atlanta, GA -----Original Message----- Hello from Steved Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. . |
I would like to thankyou all.
Cheers. -----Original Message----- Hello from Steved Please in Column A how do i find the last row with data using a macro. At the moment I'm on Row 1108 so can a macro find the next row in this case 1109 biut by tonight I'll be on row 1150, so in this case would it goto row 1151. Thankyou Very Much. . |
All times are GMT +1. The time now is 01:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com