GomaPile
Active Member
- Joined
- Jul 24, 2006
- Messages
- 334
- Office Version
- 365
- Platform
- Windows
Hello Everyone, can someone please help ME if you have time, and would really appeaciate your support too.
Short background story - The spreadsheet is our monthly roster split into 2 fortnightly pay periods. We have 37 rows of Casuals with Shift Times being entered by Supervisors in military hours for some eg 0700-1500, 1500-2300 or 1600-0000 inside individual single cells, and with columns E8:E44 & F8:F44 downwards adds up the total sum number of hours worked - this works fine no real issues here.
The columns from E8:E44 & F8:F44 has the formula adding up Casuals row of shift times in cell E8 etc etc... downwards.
However, what I'm finding is our Supervisors are not entering data correctly making human mistakes (in my opinion poor laziness) which is causes a problem with the adding up the number of hours worked in the columns E8:E44 & F8:F44 and returns hash symbols ### there's something wrong in that row. Couple of errors I found for examples: 700-15000 or 150-2300
The VBA code below is meant to assist our Supervisors from those human or legitimate input data errors, would like to see a pop-up Warning Value Error ### message to let our Staff know you have entered a Shift Time incorrectly.
Apparently the VBA is not bringing no the WARNING messages to indicate there's an error.
Thanks
Gary
Short background story - The spreadsheet is our monthly roster split into 2 fortnightly pay periods. We have 37 rows of Casuals with Shift Times being entered by Supervisors in military hours for some eg 0700-1500, 1500-2300 or 1600-0000 inside individual single cells, and with columns E8:E44 & F8:F44 downwards adds up the total sum number of hours worked - this works fine no real issues here.
The columns from E8:E44 & F8:F44 has the formula adding up Casuals row of shift times in cell E8 etc etc... downwards.
However, what I'm finding is our Supervisors are not entering data correctly making human mistakes (in my opinion poor laziness) which is causes a problem with the adding up the number of hours worked in the columns E8:E44 & F8:F44 and returns hash symbols ### there's something wrong in that row. Couple of errors I found for examples: 700-15000 or 150-2300
The VBA code below is meant to assist our Supervisors from those human or legitimate input data errors, would like to see a pop-up Warning Value Error ### message to let our Staff know you have entered a Shift Time incorrectly.
Apparently the VBA is not bringing no the WARNING messages to indicate there's an error.
Code:
Private Sub check(ByVal Target As Range)
If Intersect(Target, Range("E8:F44")) Is Nothing Then Exit Sub
If Target.Value <> "###" Then Exit Sub
MsgBox "You have entered an incorrect Shift Time " & Target.Address
End Sub
Thanks
Gary
Last edited: