3_入荷 検索値に登録 ボタン

Sub 未入力登録() 'このシート

Dim i As Long
Dim 最終行 As String
Dim サーチ行 As Long
'高速化開始
    With Application
        .Calculation = xlCalculationManual
'        .EnableEvents = False
        .ScreenUpdating = False
    End With

Sheets("未入荷").Select
最終行 = Range("B3").End(xlDown).Row
サーチ行 = 0
For i = 2 To 最終行
 If Range("A2") = Range("B" & i) Then  '送り状No★

Cells(i, 17) = UserForm1.TextBox15.Value  'カーゴ集計No
Cells(i, 15) = UserForm1.TextBox1.Value  '入荷日
Cells(i, 16) = UserForm1.TextBox13.Value 'カーゴNo
Cells(i, 18) = UserForm1.Label21.Caption 'カーゴ集計No大口
Cells(i, 19) = UserForm1.TextBox6.Value 'G/W

If UserForm1.TextBox4.Text <> UserForm1.TextBox8.Text Then
Cells(i, 14) = UserForm1.TextBox4.Value '口数
Cells(i, 10) = UserForm1.TextBox4.Value '口数
End If

サーチ行 = i
Exit For
End If
Next i

If サーチ行 = 0 Then
MsgBox UserForm1.TextBox1.Value & "送り状Noはありません。", vbInformation, "該当無し"
End If
'高速化終了
    With Application
        .Calculation = xlCalculationAutomatic
'        .EnableEvents = True
        .ScreenUpdating = True
    End With

End Sub