Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,665
- Office Version
- 365
- 2016
- Platform
- Windows
I am receiving a 'ByRef argument type mismatch' error with the highlighted code below...
In my testing wstime1 should equal "<2:30 PM" (can't check as the code errors before i can step through)
'GetFirstNumeric' is a function ...
Is anyone able to provide any suggestions on the possible cause of this error and how to resolve it?
Rich (BB code):
Dim wstime1, wstime2, wstime3, wstime4, wstime5 As String
Dim lNumber1, lNumber2, lNumber3, lNumber4, lNumber5 As Long
wstime1 = Application.WorksheetFunction.VLookup(lrid, rvl5, 43, False)
wstime2 = Application.WorksheetFunction.VLookup(lrid, rvl5, 46, False)
lNumber1 = GetFirstNumeric(wstime1)
lNumber2 = GetFirstNumeric(wstime2)
In my testing wstime1 should equal "<2:30 PM" (can't check as the code errors before i can step through)
'GetFirstNumeric' is a function ...
Rich (BB code):
Function GetFirstNumeric(s As String) As Long
Dim u As Long
For u = 1 To Len(s)
If Mid(s, u, 1) Like "#" Then
GetFirstNumeric = u
Exit For
End If
Next u
End Function
Is anyone able to provide any suggestions on the possible cause of this error and how to resolve it?