|    | 
     いろいろテストしてみましたが、こんな感じがベストのように思います。 
入力漏れがあったときは、そのテキストボックスへ入力した後、Enterを 
数回押さないと転記されないという不満が残りますが、そこまて解消 
したければ、TextBox4以外の全てのテキストボックスの Changeイベント 
などで、全ボックスの値をチェックするようなマクロが必要になります。 
 
Private Sub CommandButton1_Click() 
  Dim i As Integer 
  Dim Uf As UserForm 
 
  Set Uf = UserForms(0) 
  For i = 1 To 4 
   If Uf.Controls("TextBox" & i).Text = "" Then 
     MsgBox "TextBox" & i & " が入力されていません", 48 
     Exit Sub 
   End If 
  Next i 
  With Sheets("Sheet1").Cells(65536, 1).End(xlUp) 
   For i = 1 To 4 
     .Offset(1, i - 1).Value = _ 
     Uf.Controls("TextBox" & i).Text 
     Uf.Controls("TextBox" & i).Text = "" 
   Next i 
  End With 
  Uf.TextBox1.SetFocus: Set Uf = Nothing 
End Sub 
 
Private Sub TextBox4_AfterUpdate() 
  Set Uf = UserForms(0) 
  With Uf 
   If .TextBox1.Text = "" And _ 
   .TextBox2.Text = "" And _ 
   .TextBox3.Text = "" And _ 
   .TextBox4.Text = "" Then 
     Set Uf = Nothing: Exit Sub 
   End If 
  End With 
  For i = 1 To 4 
   If Uf.Controls("TextBox" & i).Text = "" Then 
     MsgBox "TextBox" & i & " が入力されていません", 48 
     Exit Sub 
   End If 
  Next i 
  With Sheets("Sheet1").Cells(65536, 1).End(xlUp) 
   For i = 1 To 4 
     .Offset(1, i - 1).Value = _ 
     Uf.Controls("TextBox" & i).Text 
     Uf.Controls("TextBox" & i).Text = "" 
   Next i 
  End With 
  Uf.TextBox1.SetFocus: Set Uf = Nothing 
End Sub 
 
 | 
     
    
   |