Search code examples
excelvba

Get a first column range from a range in Excel VBA


I would like to get a range of the first column from a larger range. For example:

If the range is $E$9:$I$259, the result should be $E$9:$E259

How can I achieve this?


Solution

  • By using the columns collection of the range object like so:

    Range("$E$9:$I$259").Columns(1)