Worksheet.Columns (Excel)

Returns a Range object that represents all the columns on the specified worksheet.

Using the Columns property without an object qualifier is equivalent to using ActiveSheet.Columns. If the active document isn't a worksheet, the Columns property fails. To return a single column, use the Item property or equivalently include an index in parentheses. For example, Columns(1), Columns("A"), Columns.Item(1) and Columns.Item("A") return the first column of the active sheet.


Dim rngColumns As Range
Set rngColumns = ActiveSheet.Columns