Shortz
04-04-2010, 08:13 AM
Hi guys,
This maybe a very simple question but i currently have a form which when the "process" button is clicked it triggers this code:
Private Sub ProcessBut_Click()
Application.ScreenUpdating = False
Select Case SQForm.WG.Value
Case ""
Exit Sub
Case Else
Process.PPLevelCheck
Process.PPCheck
Process.OutSheetName
Process.OutSheetCopy
Process.Checker
Process.Queryruns
End Select
Application.ScreenUpdating = True
End Sub
most of these macros are error checking such as OutSheetName which checks if the inputted name for a new worksheet already exists.
Currently these nested macros are coded to 'Exit Sub' when certain conditions are met eg. worksheet already exists. When it does this it merely exits the particular nested macro and proceeds to the next one on the list, rather than taking me back to the form for the user to amend the error.
What is the best way to deal with this? should i just use the 'End' command?
IDEALLY what i want is that when one of the nested macros exit then it will display the message i've written in them and go back to the userform.
thanks in advance!
This maybe a very simple question but i currently have a form which when the "process" button is clicked it triggers this code:
Private Sub ProcessBut_Click()
Application.ScreenUpdating = False
Select Case SQForm.WG.Value
Case ""
Exit Sub
Case Else
Process.PPLevelCheck
Process.PPCheck
Process.OutSheetName
Process.OutSheetCopy
Process.Checker
Process.Queryruns
End Select
Application.ScreenUpdating = True
End Sub
most of these macros are error checking such as OutSheetName which checks if the inputted name for a new worksheet already exists.
Currently these nested macros are coded to 'Exit Sub' when certain conditions are met eg. worksheet already exists. When it does this it merely exits the particular nested macro and proceeds to the next one on the list, rather than taking me back to the form for the user to amend the error.
What is the best way to deal with this? should i just use the 'End' command?
IDEALLY what i want is that when one of the nested macros exit then it will display the message i've written in them and go back to the userform.
thanks in advance!