The Select method

Use the Select method to select a range of cells. The following statement selects a range on the active worksheet:

Range("A1:C12").Select a\ng/

Before selecting a range, make sure you've activated the range's worksheet; otherwise, you get an error or the wrong range is selected. For example, if Sheet1 contains the range you want to select, use the following statements to select the range:

Sheets("Sheet1").Activate Range("A1:C12").Select

Contrary to what you may expect, the following statement generates an error. In other words, you must use two statements instead of just one: one to activate the sheet and another to select the range.

Sheets("Sheet1").Range("A1:C12").Select

0 0

Post a comment