VBAでセルの範囲を指定する Range,Cells

Rangeプロパティを使って、セルの範囲を指定します。

いろいろな書式がありますが、

    Range(セル1,セル2)

の形式が一番よく使うものだと思います。
Range(“A1″,”B3″).Select
とすると、

こんな感じで選択されます。

ただ、マクロ内ではR1C1形式で指定するのが簡単なので、

Cellsプロパティを使って、セルを数値で指定するほうがやりやすいです。

    Cells(行,列)

と指定します。

上記の

Range(“A1″,”B3″).Select

をCellsを使って表すと、

Range(Cells(1,1),Cells(2,3)).Select

となります。

VBAのお勉強 まとめへ戻る

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 simple blog いろいろ勉強中 Suffusion theme by Sayontan Sinha