I keep getting error 9
when I try to import a sheet from another workbook to my current workbook.
This is my code. It keeps highlighting the last row in yellow. I'm trying to copy a sheet called sheet1
from a workbook called MB_OP Report_Today'sDate
to the workbook AEM_WK_current week
.
Sub InQltyMB_1()
' InQlyMB Macro
' Imports the MB sheet
For WeekNum = 40 To 2500
szToday = Format(Date, "MM.D.YYYY")
Windows("MB_OP Report_" & szToday & ".XLS").Activate
Sheets("Sheet1").Select
Sheets("Sheet1").Copy Before:=Workbooks("AEM_WK_" & WeekNum & ".xlsx").Sheets(1)
Next WeekNum
End Sub