Hello,

I am writing a macro that when runs pulls a range of data from Workbooks located in a particular folder into a master workbook (located elsewhere).

I would like for the macro to only pull data from (source) workbooks that have been modified after the date that the macro was last run.

My initial thoughts were to create a date stamp in the master book by doing this:

Range("a1").Value = Now
Range("a1").Copy
Range("a1").PasteSpecial (xlPasteValues)
and then to have the macro look for DateLastModified > Date Stamp

I have hit the ceiling of my current knowledge and have not succeeded.

Is there a better way of doing this? Could this work?

Any help greatly appreciated.

Current code here:

Sub Pullfrom()
Dim Myfile As String
Dim erow

Myfile = Dir("S:\NJR\SEC\MC\Test\")

Do While Len(Myfile) > 0

Workbooks.Open (Myfile)
Range("B4:D100").Copy
Application.DisplayAlerts = False
ActiveWorkbook.Close

erow = Sheet1.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range(Cells(erow, 2), Cells(erow, 4))

Myfile = Dir

Loop

Application.DisplayAlerts = True

Range("a1").Value = Now
Range("a1").Copy
Range("a1").PasteSpecial (xlPasteValues)

End Sub