Recording Values from Workbook_1 onto Workbook_2

38 Views Asked by At

Having issues linking the values from Workbook_1 to appear on Workbook_2. I am not seeing the syntax error. Set Capture line is flagged. Any help much appreciated.

Sub RecordData()
Dim NextTime As Date
Dim Interval As Double
Dim cel As Range
Dim Capture As Range

Application.StatusBar = "Recording Started"
Set Capture = Workbooks("Workbook_1.xlsm").Worksheets(“Dashboard”).Range("A22:B22") 'Capture this row of data from Workbook_1
With Worksheets("Log") 'Record the data from Workbook_1 on this sheet on Workbook_2
    Set cel = .Range("A2") 'First timestamp goes here
    Set cel = .Cells(.Rows.Count, cel.Column).End(xlUp).Offset(1, 0)
    cel.Value = Now
    cel.Offset(0, 1).Resize(Capture.Rows.Count, Capture.Columns.Count).Value = Capture.Value
End With
NextTime = Now + TimeValue("00:01:00")
Application.OnTime NextTime, "RecordData"
End Sub
0

There are 0 best solutions below