sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
Good Morning,
Trying to compile a workbook, I keep getting a few errors. Here are the first two:
Trying to compile a workbook, I keep getting a few errors. Here are the first two:
Rich (BB code):
Syntax Error:
Function TotalAdder(RCell As Range)
'Begins Error Handling Code
On Error GoTo Helper
Dim xIndex As Long
Application.Volatile
xIndex = RCell.Worksheet.Index
nsheet = Left(Tname, 4) - "Noon"
If xIndex > 1 Then
TotalAdder = Worksheets(nsheet + xIndex - 1).Range(RCell.Address)
End If
'Error Clearing Code
Exit Function
Helper:
resp = MsgBox("We're sorry to see you've encountered an error." & vbCrLf & vbCrLf & "To proceed, we recommend you contact the Developer " & _
"with error codes [1143] and " & "[" & Err.Number & "-" & Err.Description & "]." & vbCrLf & vbCrLf & "To attempt to patch your problem at least " & _
"temporarily, we recommend you click [Yes] to see help directions. Would you like to continue?", vbYesNoCancel, name)
If resp = vbYes Then
Call Error_Handle(sProcName, Err.Number, Err.Description))
ElseIf resp = vbNo Then
Exit Function
ElseIf resp = vbCancel Then
Exit Function
End If
End Function
Rich (BB code):
Argument not Optional (Prevsheet is a function)
Sub Formula_Chooser()
'Begins Error Handling Code
On Error GoTo Helper
Dim Form1 As Double
Dim Form2 As Double
Dim ws As Worksheet
Form1 = FormulaR1C1 = Sheets("Voyage Specifics").Range("D8")
Form2 = FormulaR1C1 = PrevSheet.Range("D8")
Set ws = ActiveSheet.Previous
If ws.name Like "Noon*" Then
ActiveSheet.Range("D9") = Form2
Else: ActiveSheet.Range("D9") = Form1
End If
'Error Clearing Code
Exit Sub
Helper:
resp = MsgBox("We're sorry to see you've encountered an error." & vbCrLf & vbCrLf & "To proceed, we recommend you contact the Developer " & _
"with error codes [1171] and " & "[" & Err.Number & "-" & Err.Description & "]." & vbCrLf & vbCrLf & "To attempt to patch your problem at least " & _
"temporarily, we recommend you click [Yes] to see help directions. Would you like to continue?", vbYesNoCancel, name)
If resp = vbYes Then
Call Error_Handle(sprocname, Err.Number, Err.Description)
ElseIf resp = vbNo Then
Exit Sub
ElseIf resp = vbCancel Then
Exit Sub
End If
End Sub
Prevsheet function has been fine thus far:
Function PrevSheet(RCell As Range)
'Begins Error Handling Code
On Error GoTo Helper
Dim xIndex As Long
Application.Volatile
xIndex = RCell.Worksheet.Index
If xIndex > 1 Then
'PrevSheet = Worksheets(xIndex - 1).Range(RCell.Address)
PrevSheet = RCell.Parent.Parent.Worksheets(xIndex - 1).Range(RCell.Address).Value
End If
'Error Clearing Code
Exit Function
Helper:
resp = MsgBox("We're sorry to see you've encountered an error." & vbCrLf & vbCrLf & "To proceed, we recommend you contact the Developer " & _
"with error codes [1141] and " & "[" & Err.Number & "-" & Err.Description & "]." & vbCrLf & vbCrLf & "To attempt to patch your problem at least " & _
"temporarily, we recommend you click [Yes] to see help directions. Would you like to continue?", vbYesNoCancel, name)
If resp = vbYes Then
Call Error_Handle(sprocname, Err.Number, Err.Description)
ElseIf resp = vbNo Then
Exit Function
ElseIf resp = vbCancel Then
Exit Function
End If
End Function