Hello, I have a list of macros I run with a call list, what I want to do is create a condition that stops the list if not met.
Here is the list:
Sub Button3_Click()
Application.ScreenUpdating = False
Call export
Call Step1
Call BlankDelete
Call FullDelete
Call IndDelete
Call ResDelete
Call PermanentDelete
Call Step2
Call email
Application.ScreenUpdating = True
End Sub
Current the export macro is this:
Sub export()
For Each wb In Application.Workbooks
If wb.Name Like "export*" Then
wb.Activate
Exit For
End If
Next wb
End Sub
I want to change it so that if it doesn't find the wb.name like "export*", then it gives an error message: "Export workbook not found" and it ends the call list of macros. Any help to achieve this is greatly appreciated!
Here is the list:
Sub Button3_Click()
Application.ScreenUpdating = False
Call export
Call Step1
Call BlankDelete
Call FullDelete
Call IndDelete
Call ResDelete
Call PermanentDelete
Call Step2
Call email
Application.ScreenUpdating = True
End Sub
Current the export macro is this:
Sub export()
For Each wb In Application.Workbooks
If wb.Name Like "export*" Then
wb.Activate
Exit For
End If
Next wb
End Sub
I want to change it so that if it doesn't find the wb.name like "export*", then it gives an error message: "Export workbook not found" and it ends the call list of macros. Any help to achieve this is greatly appreciated!