Hi guys
I found this code on here, originally posted by AlphaFrog. im having a little difficulty using it for what i need.
i have filtered date on Filter_CSM, where dates are entered to the record in col H, there is a record number in col L.
I need to be able to find the cell with the dates, offset and use the record number in col l , copy the range a:l, find the corresponding record # in worksheet Data and paste over with the data from copied range in filter_CSM.
im not sure how to use the offset using the code below.
i hope that makes sense.
Here is the code:-
Thank you in advance
Ally
I found this code on here, originally posted by AlphaFrog. im having a little difficulty using it for what i need.
i have filtered date on Filter_CSM, where dates are entered to the record in col H, there is a record number in col L.
I need to be able to find the cell with the dates, offset and use the record number in col l , copy the range a:l, find the corresponding record # in worksheet Data and paste over with the data from copied range in filter_CSM.
im not sure how to use the offset using the code below.
i hope that makes sense.
Here is the code:-
Code:
Sub MatchCopyPaste()
Dim wsSource As Worksheet, wsDest As Worksheet
Dim cell As Range, Found As Range
Set wsSource = Worksheets("Filter_CSM") ' Source
Set wsDest = Worksheets("Data") ' Destination
Application.ScreenUpdating = False
With wsDest
' Filter destination sheet column B for blanks
.Columns("A:L").AutoFilter Field:=8, Criteria1:="<>"
' Loop through column I visible cells
For Each cell In .Range("A2", .Range("l" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeVisible)
' Look for match on Source worksheet
Set Found = wsSource.Columns("L").Find(cell, , , xlWhole, xlByRows, xlNext, False)
' Copy\Paste if match found
If Not Found Is Nothing Then
cell.Offset(, 1).Resize(, 4).Value = Found.Offset(, 1).Resize(, 4).Value
End If
Next cell
' Clear autofilter
.AutoFilterMode = False
End With
Application.ScreenUpdating = True
MsgBox "Done.", vbInformation, "Copy Complete"
End Sub
Thank you in advance
Ally