Worksheets("Sheet1").Range("C1").Formula = "=A1+B1"
実行結果
A | B | C | |
---|---|---|---|
1 | 1 | 10 | 11 |
Worksheets("Sheet1").Range("C1:C3").Formula = "=A1*B1"
実行結果
A | B | C | |
---|---|---|---|
1 | 1 | 10 | 10 |
2 | 2 | 10 | 20 |
2 | 3 | 10 | 30 |
Worksheets("Sheet1").Range("C1:C3").Formula = "=SUM(A1:B1)"
実行結果
A | B | C | |
---|---|---|---|
1 | 1 | 10 | 11 |
2 | 2 | 10 | 12 |
2 | 3 | 10 | 13 |
With Worksheets("Sheet1")
.Range("C1").Formula = "=SUM(A1:B1)"
' C1の値をC3までコピー
.Range("C1").AutoFill Destination:=.Range("C1:C3")
End With
実行結果
A | B | C | |
---|---|---|---|
1 | 1 | 10 | 11 |
2 | 2 | 10 | 12 |
2 | 3 | 10 | 13 |