Hi,
I am new to VBA an trying to write a function that the result wil be a two letter string that shows what type of hours have been worked on an Overtime form. The choices are OT for Overtime, AD for Additional hours or CO for Callout hours.
I have written the below script but no result is produced am I am at a loss to work out what I have missed. Can anyone please help?
Function HoursType(OrdinaryHours As Single, ExtraHoursWorked As Single, Callout As String) As String
Dim totalHours As Single
totalHours = OrdinaryHours + ExtraHoursWorked
Dim standardHours As Single
standardHours = 76
If totalHours > standardHours & Callout = "N" Then
HoursType = "OT"
End If
If totalHours > standardHours & Callout = "Y" Then
HoursType = "CO"
End If
If totalHours < standardHours Then
HoursType = "AH"
End If
End Function
Bookmarks