YasserKhalil
Well-known Member
- Joined
- Jun 24, 2010
- Messages
- 852
I have the following UDF that generates a string
How can I evaluate the string output so as to be able to have the same result as if I typed it as command line? I mean the string used "الحديث" is converted by the UDF to that string
How can I evaluate the line to be able to use like that
Posted here too
VBA Code:
Sub Test_ConvertToUnicode_UDF()
Dim s
s = ConvertToUnicode("الحديث")
Debug.Print Evaluate("""" & s & """")
End Sub
Function ConvertToUnicode(ByVal sInput As String)
Dim s As String, i As Long
For i = 1 To Len(sInput)
s = s & "Chr(" & Asc(Mid(sInput, i, 1)) & ")" & IIf(i <> Len(sInput), ", ", Empty)
Next i
ConvertToUnicode = "Join(Array(" & s & "), Empty)"
End Function
VBA Code:
Join(Array(Chr(199), Chr(225), Chr(205), Chr(207), Chr(237), Chr(203)), Empty)
How can I evaluate the line to be able to use like that
VBA Code:
Debug.Print Join(Array(Chr(199), Chr(225), Chr(205), Chr(207), Chr(237), Chr(203)), Empty)
Posted here too
Evaluate string to join 1D array
I have the following UDF that generates a string Sub Test_ConvertToUnicode_UDF() Dim s s = ConvertToUnicode("الحديث") Debug.Print Evaluate("""" & s &am...
stackoverflow.com
Evaluate string to join 1D array - Eileen's Lounge
www.eileenslounge.com