D3allamerican07
Board Regular
- Joined
- Jul 22, 2015
- Messages
- 101
I have a macro that opens several files, calls a macro, and needs to be able to save the file as a new name once fixed. The code I need should notify the user they are about to save the file with a new name if an error was found.
Code:
If Sheets("ErrorSheet").Range("A2") = "" Then
MsgBox "There were no errors found on this template. Do you want to save the file as: " & myFile, vbYesNo + vbQuestion, "Save File"
'Save and Close Workbook
wb.Close SaveChanges:=True
ElseIf Sheets("ErrorSheet").Range("A2") <> "" Then
MsgBox "Errors were found on this template. Do you want to save the file as: " & myFile, vbYesNo + vbQuestion, "Save File"
wb.SaveAs myPath & & "(ERRORS_FOUND)" & myExtension)
wb.Close
End If