Visual Basic For Applications Tips


セルの選択


非常に単純ですが、私はよく忘れます。

'全選択
Cells.Select

'セルを選択
Range("B5").Select

'列を選択

Range("K:K").Select

'複数の列を選択
Range("C:C,D:D,E:E,I:I,H:H,L:L").Select

'A1〜C3のセルを選択
Range("A1:C3").Select

'2行目を選択
Range("2:2").Select

'1行目〜5行目を選択
Range("1:5").Select

'数式が格納されているセルを選択
Cells.SpecialCells(xlFormulas).Select

'定数が格納されているセルを選択
Cells.SpecialCells(xlConstants).Select