Reputation: 1739
I'm trying to paste data into a worksheet below the data. I've got the following:
Set BaseWks = Workbooks("Data.xlsx").Worksheets("Total Data")
rnum = BaseWks.Worksheets("Total Data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
But it gives me an error: method or data member not found
. What am I doing worng?
Upvotes: 0
Views: 59
Reputation: 23081
You just need
rnum = BaseWks.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).row
as you have already defined BaseWks
as that sheet.
You also need .row
on the end to return the row number.
If you want the cell itself you need Set rnum= ...
instead.
Upvotes: 2