I have a code like this
Sub Test()
Dim ArrayStrings()
Dim T As String, myResult As String
ArrayStrings = Array("String1", "String2", "String3", "String4", "String5", "StringN")
T = "myString"
myResult = myFunction(T, ArrayStrings(1))
End Sub
Function myFunction(Tx1 As String, Tx2 As String) As String
'myCode
End Function
This get an error "type mismatch" on "ArrayStrings(1)"
I tryed different ways but the only working seems to be:
myResult = myFunction(T, CStr(ArrayStrings(1)))
But it seems strange convert a string to a string ... isn't it? Is there any other way?
Arrayto a string, not aStringto a stringarray(1)element to astringvariable and pass that to the function, or declareTx2 As Variant