autigers
Board Regular
- Joined
- Oct 9, 2005
- Messages
- 139
Hello ... getting close to testing with this thing ..
I have the code below which executes mutiple macros within ...
What I would like to have happen is that if there is an error after the Sheets("EETimecard").select occurs then I wish to have a message box and the code to stop ....
I have the code below which executes mutiple macros within ...
What I would like to have happen is that if there is an error after the Sheets("EETimecard").select occurs then I wish to have a message box and the code to stop ....
Code:
Sub RunDailyTotals()
On Error GoTo TheEnd
Application.ScreenUpdating = False
Application.Run ("InputChange")
Application.Run ("EETime")
MsgBox ("You are about about to update your shift end numbers. ")
Sheets("EETimecard").Select
'Sheets("EETimecard").PrintOut Copies:=2, Collate:=True
MsgBox ("Please check the printer. The Employee Timcard is complete for ") & Date
Application.Run ("Cal_DailyTotals")
Application.Run ("ExportHours")
MsgBox ("Daily Totals Completed. You must now fill in the Staffing & Daily Numbers ")
Application.Run ("Open_DailyProd")
TheEnd: Sheets("Log").Visible = xlSheetVisible
'add username date and time
Sheets("Log").Range("B65536").End(xlUp).Offset(1, 0).Value = UserName
Sheets("Log").Range("C65536").End(xlUp).Offset(1, 0).Value = NameOfComputer
Sheets("Log").Range("D65536").End(xlUp).Offset(1, 0).Value = Date
Sheets("Log").Range("D65536").End(xlUp).NumberFormat = "dd mmm yyyy"
Sheets("Log").Range("E65536").End(xlUp).Offset(1, 0).Value = Time
Sheets("Log").Range("G65536").End(xlUp).Offset(1, 0).Value = "User Err on End of shift"
Sheets("Log").Range("H65536").End(xlUp).Offset(1, 0).Value = Err.Description
Application.ScreenUpdating = True
Sheets("DailyInput").Select
End Sub