LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default ByRef argument type mismatch (repost)

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Compile Error: ByRef argument type mismatch" when calling my function from another module ker_01 Excel Programming 2 August 14th 08 03:53 PM
ByRef Argument Type Mismatch Sprinks Excel Programming 5 August 8th 08 04:11 PM
ByRef Argument Type mismatch Tone[_4_] Excel Programming 4 July 3rd 08 02:35 PM
ByRef argument type mismatch when passing dictionary object signon77 Excel Programming 7 January 8th 08 10:03 PM
ByRef argument type mismatch error? sermest Excel Programming 4 June 17th 05 06:50 PM


All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"