Sub LogisticsSchedule_Click()
Dim mydata As Workbook
Dim tWB As Workbook
Dim item1stInj As String
Dim itemCustomer As String
Dim i As Integer
Set tWB = ThisWorkbook
Set mydata = Workbooks.Open("N:\Logistics\Logistics Tracker\Logistics Tracker 2.xlsm")
If tWB.Worksheets("Dispensing").Range("G29") > 0 Then
For i = 5 To 28
If tWB.Worksheets("Dispensing").Cells(i, 3) > 0 Then
itemDate = tWB.Worksheets("Dispensing").Range("A3")
itemRUN1 = tWB.Worksheets("Dispensing").Range("N2")
itemCustomer = tWB.Worksheets("Dispensing").Cells(i, 1)
item1stInj = tWB.Worksheets("Dispensing").Cells(i, 12)
RowCount = mydata.Worksheets("Logistics Tracker").Range("A4").CurrentRegion.Columns(1).SpecialCells(xlBlanks)(1).Row - 4
With mydata.Worksheets("Logistics Tracker").Range("A4")
.Offset(RowCount, 0) = itemDate
.Offset(RowCount, 1) = itemCustomer
.Offset(RowCount, 2) = "FDG"
.Offset(RowCount, 3) = itemRUN1
.Offset(RowCount, 8) = item1stInj
End With
End If
Next i
End If
If tWB.Worksheets("Dispensing").Range("G29") > 0 Then
For i = 5 To 28
If tWB.Worksheets("Dispensing").Cells(i, 3) > 0 Then
itemDate = tWB.Worksheets("Dispensing").Range("A3")
itemRUN1 = tWB.Worksheets("Dispensing").Range("N2")
itemCustomer = tWB.Worksheets("Dispensing").Cells(i, 1)
item1stInj = tWB.Worksheets("Dispensing").Cells(i, 12)
RowCount = mydata.Worksheets("Customer Manifest").Range("D10").CurrentRegion.Rows.Count
With mydata.Worksheets("Customer Manifest").Range("D10")
.Offset(RowCount, 0) = itemCustomer
.Offset(RowCount, 1) = itemRUN1
.Offset(RowCount, 2) = "FDG"
.Offset(RowCount, 5) = item1stInj
End With
End If
Next i
End If
End Sub