fork download
  1. Private Sub CommandButton1_Click()
  2. Dim i As Integer
  3. Dim iCheck As Integer
  4. Dim RowNum As Long
  5. '入力チェック
  6. If Me.TextBox1 = "" Then
  7. MsgBox "日付が入力されてません"
  8. Exit Sub
  9. End If
  10. If Me.TextBox2 = "" Then
  11. MsgBox "担当が入力されてません"
  12. Exit Sub
  13. End If
  14. If Me.ComboBox1 = "" Then
  15. MsgBox "出荷先が入力されてません"
  16. Exit Sub
  17. End If
  18. If Me.TextBox3 = "" Then
  19. MsgBox "シリアル№が入力されてません"
  20. Exit Sub
  21. End If
  22. If Me.ComboBox2 = "" Then
  23. MsgBox "販売形式が入力されてません"
  24. Exit Sub
  25. End If
  26. For i = 1 To 20000
  27. If Cells(i, 1).Value = "" Then Exit For
  28. Next
  29. '重複チェック
  30. iCheck = i
  31. For iCheck = 1 To i
  32. If CheckBox1.Value = False Then
  33. '今までの処理
  34. If Cells(iCheck, 4).Value = Me.TextBox3.Text Then
  35. If Cells(iCheck, 17).Value = "" Then
  36.  
  37. '~~~~省略~~~~
  38.  
  39. Cells(iCheck, 23).Value = ""
  40. End If
  41. Exit Sub
  42. Else
  43. MsgBox "既に出荷されてます"
  44. Cells(iCheck, 4).Select
  45. Me.TextBox3.SetFocus
  46. Exit Sub
  47. End If
  48. Else
  49. '回答者追加分
  50. Cells(iCheck, 24).Value = CDate(TextBox1.Value)
  51. Cells(iCheck, 25).Value = Me.ComboBox1
  52. Cells(iCheck, 26).Value = Me.ComboBox2
  53. Cells(iCheck, 27).Value = Me.TextBox2
  54. Cells(iCheck, 17).Value = ""
  55. Cells(iCheck, 18).Value = ""
  56. Cells(iCheck, 19).Value = ""
  57. Cells(iCheck, 20).Value = ""
  58. Cells(iCheck, 21).Value = ""
  59. Cells(iCheck, 22).Value = ""
  60. Cells(iCheck, 23).Value = ""
  61. End If
  62. Next
  63. End Sub
  64.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty