See attached file where I used this code:
Sub getData()
Dim myDate As Date, newWb As Workbook, myFileName As String
myDate = ThisWorkbook.Sheets("sheet1").Range("b1")
'file name: x:\reports\yyyy\mm_monthname\reports_yyyymmdd\reports_yyyymmdd.xlsm
myFileName = "x:\reports\" & Year(myDate) & "\" & Format(Month(myDate), "00") _
& "_" & MonthName(Month(myDate)) & "\Reports_" & Format(myDate, "yyyymmdd") _
& "\Reports_" & Format(myDate, "yyyymmdd") & ".xlsm"
Application.ScreenUpdating = False
Set newWb = Workbooks.Open(myFileName)
'copy range a1:a24 from opened workbook
newWb.ActiveSheet.Range("a1:a24").Copy ThisWorkbook.Sheets("sheet1").Range("b4")
newWb.Close False
Application.ScreenUpdating = True
End Sub
Regards,
Antonio
Bookmarks