|
わいわいさんへ
一応思っていた動作ができるようになりました。
Private Sub CommandButton2_Click()
Dim x As Date
For x = 1 To 10000
If Worksheets("Sheet3").Cells(5 + x, 2).Value = "" Then
Worksheets("Sheet3").Cells(5 + x, 2).Value = TextBox1.Text
Worksheets("Sheet3").Cells(5 + x, 3).Value = Now
Worksheets("Sheet3").Cells(5 + x, 4).Value = TextBox3.Text
Worksheets("Sheet3").Cells(5 + x, 5).Value = TextBox4.Text
Worksheets("Sheet3").Cells(5 + x, 6).Value = TextBox5.Text
Worksheets("Sheet3").Cells(5 + x, 7).Value = TextBox6.Text
Exit For
End If
Next
Worksheets("Sheet4").Cells(16, 2).Value = TextBox1.Text
Worksheets("Sheet4").Cells(2, 3).Value = Now
Worksheets("Sheet4").Cells(5, 2).Value = TextBox3.Text
Worksheets("Sheet4").Cells(5, 4).Value = TextBox4.Text
Worksheets("Sheet4").Cells(5, 7).Value = TextBox5.Text
Worksheets("Sheet4").Cells(5, 5).Value = TextBox6.Text
Worksheets("Sheet4").PrintOut
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
UserForm1.Hide
End Sub
です。
改善のアドバイスをお願いします。
|
|