「VBA」For Eachで指定セル範囲に値を入力するサンプル
書式
For Each 変数名 In Range(セル範囲)
使用例
Sub funcA()
Dim cft As Range
' for ech ループ
For Each cft In Range("D3:E6")
cft.Value = "test01"
Next
End Sub
Sub funcA()
Dim cft As Range
' for ech ループ
For Each cft In Range("D3:E6")
cft.Value = "test01"
Next
End Sub
Sub funcA() Dim cft As Range ' for ech ループ For Each cft In Range("D3:E6") cft.Value = "test01" Next End Sub