hey guys, new to this forum but have used your tips countless times!
trying to copy workbook A and paste in new location with slightly different name:
Getting Error Mismatch:
Set PREV_A= "fileA" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & "AA.xlsb"
Set PREV_B = "fileB" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & "BB.xlsb"
Set PREV_C= "fileC" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyy mm dd") & ").xlsm"
Set NEW_A= "fileA_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & "AA.xlsb"
Set NEW_B= "fileB_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & "BB.xlsb"
Set NEW_C= "fileC_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyy mm dd") & ").xlsm"
Workbooks("PREV_A").SaveCopyAs ("NEW_A")
Workbooks("PREV_B").SaveCopyAs ("NEW_B")
Workbooks("PREV_C").SaveCopyAs ("NEW_C")
End Sub
trying to copy workbook A and paste in new location with slightly different name:
Getting Error Mismatch:
Set PREV_A= "fileA" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & "AA.xlsb"
Set PREV_B = "fileB" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -2), "yyyymmdd") & "BB.xlsb"
Set PREV_C= "fileC" & Format(WorksheetFunction.WorkDay(Date, -2), "yyyy mm dd") & ").xlsm"
Set NEW_A= "fileA_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & "AA.xlsb"
Set NEW_B= "fileB_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & Format(WorksheetFunction.WorkDay(Date, -1), "yyyymmdd") & "BB.xlsb"
Set NEW_C= "fileC_NEW" & Format(WorksheetFunction.WorkDay(Date, -1), "yyyy mm dd") & ").xlsm"
Workbooks("PREV_A").SaveCopyAs ("NEW_A")
Workbooks("PREV_B").SaveCopyAs ("NEW_B")
Workbooks("PREV_C").SaveCopyAs ("NEW_C")
End Sub