Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get a compile error, ByRef argument type mismatch,
with the following (streamlined) code. How can I fix this? BTW, Gary, I have tried all variations of the TruncateString() function that you posted. It still produces the same error. Hopefully this simplified or stripped down code and help narrow down the problem. '-------------------------------------------------------------- Function TruncateString$(sText$, sFind$, Optional lStart& = 1) TruncateString = Mid$(sText, lStart, InStr(sText, sFind) - lStart) End Function '-------------------------------------------------------------- Sub basicTest() Dim s As String Dim vData ' variant s = "Hello world. Be the world. Goodnight world." vData = Split(s, ".") MsgBox TruncateString(vData(2), "world") End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Compile Error: ByRef argument type mismatch" when calling my function from another module | Excel Programming | |||
ByRef Argument Type Mismatch | Excel Programming | |||
ByRef Argument Type mismatch | Excel Programming | |||
ByRef argument type mismatch when passing dictionary object | Excel Programming | |||
ByRef argument type mismatch error? | Excel Programming |