I reviewed the proposed questions to find the answer to my problem. The closest question is called: Number of rows in another Excel sheet. Count the number of rows in another Excel sheet.
Solving this problem does not work for me.
I am trying to count the number of rows in a range in a different worksheet than the active worksheet. Here is my code:
Sub verbflashcards() Dim wordcount As Long With Worksheets("Verbs") wordcount = .Range(Cells(4, 1), Cells(4, 1).End(xlDown)).Rows.Count End With MsgBox (wordcount) End Sub
I have a worksheet called "Verbs" and this is the second worksheet in the book. I tried:
With Verbs With Sheet2 With Sheets("Verbs") With Sheets("Sheet2")
None of them seem to work.
vba excel-vba excel with-statement
user2859603
source share