5_入荷 カーゴ表

Sub カーゴ表1()  '貼付けに変更

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

Workbooks.Open FileName:="D:\JBRC検収システム\03_入力済データ\カーゴデータ.xlsm"

Sheets("カーゴ表").Select
最終行 = Range("B1").End(xlDown).Row
サーチ行 = 0
For i = 2 To 最終行

Cells(i, 2) = UserForm1.TextBox15.Value  'カーゴ集計No
Cells(i, 7) = UserForm1.TextBox1.Value  '入荷日
Cells(i, 3) = UserForm1.TextBox13.Value 'カーゴNo
Cells(i, 6) = UserForm1.Label21.Caption 'カーゴ集計No大口
Cells(i, 5) = UserForm1.TextBox9.Value '送状枚数
Cells(i, 4) = UserForm1.TextBox10.Value '総個数

サーチ行 = i
Exit For
'End If
Next i
閉じるカーゴ

'高速化終了
    With Application
        .Calculation = xlCalculationAutomatic
        .EnableEvents = True
        .ScreenUpdating = True
    End With

End Sub

---------------------------------------------------------------------------------
Sub カーゴ集計入力()
Dim i As Long
Dim 最終行 As String
Dim サーチ行 As Long
'高速化開始
    With Application
        .Calculation = xlCalculationManual
        .EnableEvents = False
        .ScreenUpdating = False
    End With

Sheets("カーゴ集計").Select
最終行 = Range("B65536").End(xlUp).Row
サーチ行 = 0

Cells(2, 7) = UserForm1.TextBox1.Value  '入荷日
Cells(最終行 + 1, 1) = UserForm1.TextBox15.Value 'カーゴ集計No

Cells(最終行 + 3, 2) = UserForm1.Label21.Caption 'カーゴ集計No大口
'高速化終了
    With Application
        .Calculation = xlCalculationAutomatic
        .EnableEvents = True
        .ScreenUpdating = True
    End With

End Sub