Hi
Welcome to board.
Put this code in a standard module on the GBook1.xls
Code:
Option Explicit
Sub kTest()
Dim wbkFrom As Workbook
Dim wbkTo As Workbook
Dim f, d As Long
On Error Resume Next
Set wbkFrom = ThisWorkbook
Set wbkTo = Workbooks("GBook2.xls") '<< adjust the name
On Error GoTo 0
If wbkTo Is Nothing Then
MsgBox "Open the other workbook first", vbInformation
Exit Sub
End If
d = wbkFrom.Worksheets(1).Range("b1") '<< date
f = Evaluate("match(" & d & "," & wbkTo.Worksheets(1).Columns(1).Address(external:=1) & ",0)")
If Not IsError(f) Then
With wbkTo.Worksheets(1).Range("b" & f)
.Resize(, 3).Value = wbkFrom.Worksheets(1).Range("b3:d3").Value2
.Offset(, 3).Resize(, 3).Value = wbkFrom.Worksheets(1).Range("b4:d4").Value2
End With
MsgBox "Done"
Else
MsgBox "Date '" & CDate(d) & "' could not be found", vbInformation
End If
End Sub
Bookmarks