always_confused
Board Regular
- Joined
- Feb 19, 2021
- Messages
- 68
- Office Version
- 2016
- Platform
- Windows
Hello,
I am trying to write a Sub in which I need the number of rows in a Range which is input as a parameter of the Sub. I can't find the syntax to get the number of rows in the range. For other functions where the range is already known (in this case Range("A:A")) when writing, I've been using:
But I'm not sure how to do the same thing in the case where I have
How can I get the number of used rows of Range(column)?
I am trying to write a Sub in which I need the number of rows in a Range which is input as a parameter of the Sub. I can't find the syntax to get the number of rows in the range. For other functions where the range is already known (in this case Range("A:A")) when writing, I've been using:
VBA Code:
lastrow = Sheets("sheetname").Range("A" & Rows.count).End(xlUp).Row
But I'm not sure how to do the same thing in the case where I have
VBA Code:
Dim column As Range
Set column = Range(M:M)
How can I get the number of used rows of Range(column)?