In the previous post I spoke about referring to cells and ranges of cells, but in the instance you need to refer to an entire row or an entire column you can do so with what was learned previously, but it would be rather cumbersome. Visual Basic has a way for us to so simply. The format is just like what we used when referring to a range, but instead of the word Range we’ll use the word Rows or Columns. A couple of examples are:
Rows(1) 'refers to row 1
Columns(1) 'refers to column 1 or you can use...
Columns("A") 'again refers to the 1st column and has to have the quotes
Columns 'no numbers or letters refers to ALL columns on the worksheet
You can also select multiple rows or columns by separating with commas like the following examples:
Rows("1:1,3:3") 'refers to multiple non-contiguous rows, i.e. row 1 AND row 3
Rows("1:3") 'refers to multiple contiguous rows, i.e. rows 1 THROUGH 3
In my next post I’ll show you a shortcut notation for referring to cells.