Hi all,
I'm trying to count the number of rows in a table in another workbook that I can reference later for a loop.
Thank you in advance
I'm trying to count the number of rows in a table in another workbook that I can reference later for a loop.
Code:
Sub Count ()
Const book2Name = "Controls.xlsx"
Dim book2 As Workbook
Set book2 = Workbooks(book2Name)
numRows = book2.Sheets("Sheet1").Range("Table1").Rows.Count
End Sub
Thank you in advance