After digging through umpteen references - I'm still trying to figure out what I'm doing wrong here. Per the comments in the code: I have a workbook where on one worksheet there is a named range - _FST with a drop down select for yes or no. Based on the answer I want to perform a SUM of 40 - named ranges. Any help greatly appreciated with virtual beer
Code:
Sub FST_CHECK()
'Routine checks Job Title of Field Service Personnel to determine how Timesheet overtime (1.5x)hours
'are calculated. FST overtime is calculated >40 hours on a Monday through Saturday basis.
'FSE & Sr. FSE overtime is calculated on a Monday through Friday basis with all Saturday hours
'worked as overtime.
Dim FS_Title As String
Dim FS_OT As Integer
FS_Title = "Sheet1._FST.Value" 'Yes=FST / No=FSE or Sr. FSE
Select Case FS_Title
Case Is = "Yes" 'If Title of FS Person is FST
FS_OT = Sheet2.Range("_OT").Formula = (40 - Sum("_HW2,_HW3,_HW4,_HW5,_HW6,_HW7,_HV2,_HV3,_HV4,_HV5,_HV6,_HV7")) 'Sum of 40-work and travel hours M-St
Case Is = "No" 'If Title of FS Person is FSE or Sr. FSE
FS_OT = Sheet2.Range("_OT").Formula = (40 - Sum("_HW2,_HW3,_HW4,_HW5,_HW6,_HV2,_HV3,_HV4,_HV5,_HV6,")) 'Sum of 40-work and travel hours M-F
Case Else
FS_OT = Sheet2.Range("_OT").Value = 0
End Select
End Sub