I am pulling data from another workbook, and I need to know the last row of any worksheet in that workbook. There will be empty row before that last row. I need to find the total number of rows of a sheet.
Printable View
I am pulling data from another workbook, and I need to know the last row of any worksheet in that workbook. There will be empty row before that last row. I need to find the total number of rows of a sheet.
Is it the last row in a particular column, or the last last row of all columns.
The column will always be D I am just want to find the last row of that column.
[vba]
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
End With
[/vba]
Sorry did not work. I am posting a example workbook with data populating sheet1. The last row will always be moving on every sheet in different workbooks.
I got the answer Iwas looking for.
wbk.Sheets(I).Range("D65536").End(xlUp).Row
Thanks for the help.
How does your solution do what you asked in your first post?
Quote:
I am pulling data from another workbook, and I need to know the last row of any worksheet in that workbook. There will be empty row before that last row. I need to find the total number of rows of a sheet.
That is what the reply in Post 4 does, when suitably qualified as per your example, but it will also work in Excel 2007 which can have rows greater than 65536.Quote:
Originally Posted by SeanJ