TextBoxの値を複数シートのセルに記入する
よろしくお願いします。
TextBoxの値を複数シートのセルに記入するようにしたいのですが
一つのシートにしか記入されません。
醜い構文ですみません。
Private Sub CommandButton1_Click()
Dim a As Long
Dim b As Long
Dim f As Long
Dim h As Long
Dim c As Range
Dim d As Range
Dim e As Range
Dim g As Range
With Worksheets(Array("駐車状態", "材料", "外壁1", "外壁2", "屋根1")).Select
Set c = Cells(1, 2)
For a = 1 To 140 Step 7
Set c = Union(c, Cells(a, 2))
c = TextBox1.Value
Next
c.EntireRow.Select
Set d = Cells(1, 4)
For b = 1 To 140 Step 7
Set d = Union(d, Cells(b, 4))
d = TextBox1.Value
Next
d.EntireRow.Select
Set g = Cells(2, 2)
For h = 2 To 141 Step 7
Set g = Union(g, Cells(h, 2))
g = TextBox2.Value
Next
g.EntireRow.Select
Set e = Cells(2, 4)
For f = 2 To 141 Step 7
Set e = Union(e, Cells(f, 4))
e = TextBox2.Value
Next
e.EntireRow.Select
End With
End Sub