Hello tranjo,
Welcome to the Forum!
The following macro has been added to the attached workbook. There is a button on the "Influent" sheet to run the macro.
Sub CopyDateByDate()
Dim Cell As Range
Dim cols As Long
Dim Data As Variant
Dim DstRng As Range
Dim LastCell As Range
Dim Search As Range
Dim SrcRng As Range
Set SrcRng = Worksheets("Influent").Range("A2")
Set LastCell = SrcRng.Parent.Cells(Rows.Count, "A").End(xlUp)
Set SrcRng = SrcRng.Parent.Range(SrcRng, LastCell)
If LastCell.Row < SrcRng.Row Then
MsgBox "There is No Data to Search.", vbOKOnly + vbExclamation
Exit Sub
End If
Set DstRng = Worksheets("Summary").Range("A2")
Set LastCell = DstRng.Parent.Cells(Rows.Count, "A").End(xlUp)
Set DstRng = IIf(LastCell.Row < DstRng.Row, DstRng, DstRng.Parent.Range(DstRng, LastCell))
col = SrcRng.Cells(1, Columns.Count).End(xlToRight).Column
ReDim Data(1 To cols)
Application.ScreenUpdating = False
With Application.FindFormat
.Clear
.NumberFormat = SrcRng.Cells(1, 1).NumberFormat
End With
For Each Cell In SrcRng
Set Search = DstRng.Find(Cell, , xlFormulas, xlWhole, xlByRows, xlNext, False, False, True)
If Not Search Is Nothing Then
Data = Cell.Resize(1, cols).Value
Search.Resize(1, cols) = Data
End If
Next Cell
Application.ScreenUpdating = True
End Sub
Bookmarks