Two of the various methods for selecting individual cells are the Range method and the Cells methods. The Cells method uses the RowIndex and ColumnIndex for its arguments while the Range method uses Cell Address for its arguments.
The following two lines of code both select cell B7.
Range(“B7”).Select
Cells(7, 2).Select
Selects the cell in Row 7 column 2 (which is cell B7)
This is it.
Range("C5").Select Selects cell C5 on the
current worksheet
Range("E3").Select
Selects
cell E3 on the current worksheet
ActiveSheet.Cells(3, 5).Select Selects cell E3 on the current worksheet
Cells(3, 5).Select Selects cell E3 on the current worksheet
ActiveSheet.Range("C5, D10, B6").Select Selects the three cells on the current worksheet.
Rows("2").Select (Select all of row 2)
Rows("3:8").Select (Select rows 3
through 8)
Range("MonthlySales").Select
Before you select a range on another worksheet you of course need to first select the worksheet.
Sheets("Sheet2").Select Selects the Sheet2 tab which makes
Sheet2 the active sheet
Sheet3.Select
Selects Sheet3
Sheet(3).Select
The argument is the index number. Selects the third worksheet
in the workbook.
To select a named range on another worksheet, first select the worksheet
Sheet3.Select
Range("MonthlySales").Select
Sheets(2).Select
Range("B3").Select
A reference to a cell in another workbook is called a link.
The Application.Goto method is used for selecting ranges in other workbooks . It combines the workbook, sheet, and range selection in one statement using either one of the following formats:
Application.Goto Workbooks("Book1.xlsx").Sheets("Sheet1").Range("B3")
Application.Goto Workbooks("Book1.xlsx").Sheets("Sheet1").Cells(3, 2)
Range("A1:F5").Select
Range("D3").Activate