How is starting and ending row number of a Range obtained?

Posted by Robert Kerr on Super User See other posts from Super User or by Robert Kerr
Published on 2010-04-21T19:10:35Z Indexed on 2010/04/21 19:14 UTC
Read the original article Hit count: 220

Filed under:
|

Given a user-selected Range, what is the simplest way to determine the starting row number, and ending row number?

Range.Address returns a string containing any number of possible formats. There has to be something simpler.

Desired:

Dim oRange As Range
Dim startRow As Integer
Dim endRow As Integer

oRange = Range("A1:X50")
startRow = oRange.Address.StartRow
endRow = oRange.Address.EndRow

of course, those properties do not exist. I want to do the same to return column letters.

© Super User or respective owner

Related posts about excel

Related posts about vba