R[-N]やC[-N] |
一つのセルの指定 |
|
|
---|---|---|
セルの範囲の指定 |
|
|
セル領域のクリア |
|
|
セルのコピー |
|
|
|
||
セルの式指定 A1形式とR1C1形式 |
|
|
|
||
|
||
アクティブセルの位置記憶 |
|
|
指定セルへのカーソル移動 |
|
|
セルの結合 |
|
|
セルの結合解除 |
|
|
セルの文字をセンター配置 |
|
1 2 3 4 5 6 7 8 9 | Sub Sample1() Dim i As Integer Dim LoopArea As Range Set LoopArea = Selection For i = 1 To LoopArea.Count LoopArea.Cells(i) = "AA" Next End Sub |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Sub Sample1() Dim RowCnt, ColCnt, StartRow, StartColumn As Integer Dim Max_Row, Max_Column As Integer Dim LoopArea As Range Dim SelectArea As String SelectArea = Selection.Address RowCnt = Selection.Row ColCnt = Selection.Column Set LoopArea = Selection StartRow = LoopArea.Cells(1).Row StartColumn = LoopArea.Cells(1).Column Max_Row = LoopArea.Cells(LoopArea.Count).Row Max_Column = LoopArea.Cells(LoopArea.Count).Column End Sub |
SelectArea : "$B$3:$F$10"
RowCnt : 3
ColCnt : 2
StartRow : 3
StartColumn : 2
Max_Row : 10
Max_Column : 6
1 2 3 4 5 6 7 8 9 10 11 12 13 | Range( "R26" ) = Date Selection.NumberFormatLocal = "yyyy" "年" "m" "月" "d" "日" ";@" With Selection .HorizontalAlignment = xlLeft .VerticalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With |
1 2 | Columns( "I" ). Select Selection.NumberFormatLocal = "#,##0" + "㎡P" |
1 2 3 | With Range( "F" & I).Interior .ColorIndex = 36 End With |