I am trying to search through Column D to find all dates = to today, then take the values in Column C and place them into a column in another workbook. I was attempting to do this in the same worksheet as a test but am having difficulty. I have some code I am working with but having trouble getting it to do what I need it to do. Workbook is attached as well
![]()
Sub FillShippingReport() Dim cel As Range Dim ws As Worksheet Dim l As Long Dim lRow As Long Dim i As Integer Dim lTarget As Long Dim aryInfo(2) As String 'Not sure how to set this, Only going to store 1 Value for each Date found Application.ScreenUpdating = False Set ws = ThisWorkbook.Sheets("2015 Log") 'set the ws variable to the current Packing List Log sheet lRow = ws.Range("D" & Rows.Count).End(xlUp).Row 'find the last row in Packing List Log For Each cel In ws.Range("D3:D300") 'loop through all ship dates, 'would like this to only run from D3 to lRow If cel.Value = (Date) Then 'if the ship date is today For l = cel.Offset(-1).Row To lRow 'loop through each cell next to todays ship dates Column C For i = 1 To 1 aryInfo(i) = Cells(l, i).Value 'save all the Packing List Numbers Next i With Sheets("Shipping Report") 'go to sheet with shipping report lTarget = .Range("C" & Rows.Count).End(xlUp).Offset(1).Row For i = 1 To 1 .Cells(lTarget, i).Value = aryInfo(i) 'copy Packing List Numbers Next i End With Next l End If Next cel Application.ScreenUpdating = True End Sub
Bookmarks