ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   String parameter including blank char (https://www.excelbanter.com/excel-programming/368104-string-parameter-including-blank-char.html)

Jean-Pierre Bidon

String parameter including blank char
 
Hi,
I'd like to put a string argument in a function. Let's say:

Function MyFun(lib as String) as Boolean

The problem comes when there is blank character in the argument "lib".
Is it possible to overcome this problem.

Thanks in advance.

--
Jean-Pierre Bidon
Interstat
5 place de la République
75003 Paris
Tél: 01 45 49 19 17



NickHK

String parameter including blank char
 
Jean-Pierre,
What do mean by a blank character ?Does this work for you?
Private Sub CommandButton1_Click()
Dim i As Long
For i = 0 To 255
Debug.Assert LenTest("123" & Chr(i) & "567") = 7
Next
End Sub

Function LenTest(argStr As String) As Long
LenTest = Len(argStr)
End Function

NickHK

"Jean-Pierre Bidon" wrote in message
...
Hi,
I'd like to put a string argument in a function. Let's say:

Function MyFun(lib as String) as Boolean

The problem comes when there is blank character in the argument "lib".
Is it possible to overcome this problem.

Thanks in advance.

--
Jean-Pierre Bidon
Interstat
5 place de la République
75003 Paris
Tél: 01 45 49 19 17






All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com