A1セルの選択(よく使う方法)
Sub 特定セルの選択A1セル()
Dim 列 As String ”「列」を文字列に指定
Dim 行 As Long ”「行」を行数(数字)に指定 ※Integerは既に非推奨
Dim i As Long ”一般的な「数字」の表現方法。数字に指定。
列 = “A” ”変数「列」に文字列「A」を設定 ※文字列は「”」で囲う事
行 = 1 ”変数「行」に数字の「1」を設定
i = 1 ”変数「i」 に数字の「1」を設
”=== Range表現 ===============================
Range(“A1”).Select ‘一般表現 (range)
Range(“A” & i).Select ‘一般表現 (range)
Range(列 & i).Select ‘複合表現 (range)
Range(“A” & 1).Select ‘複合表現 (range)
Range(列 & 行).Select ‘日本語表現(range)
”=== Cells表現 ===============================
Cells(1, 1).Select ‘一般表現 (Cells)
Cells(i, “A”).Select ‘一般表現 (Cells)
Cells(1, 列).Select ‘複合表現 (Cells)
Cells(i, 列).Select ‘複合表現 (Cells)
Cells(列, 行).Select ‘日本語表現(range)
”=== Range in Cells表現(例) =======================
Range(Cells(1, 1), Cells(行, 4)).Select
”=== Cells in Range表現(例) =======================
Cells(Range(“A1”).Row, Range(“A1”).Column).Select
End Sub

コメント