variant into string

Hello Guys,
                  I got a string value "A" in a variant array that shows Variant/String type for the string's values. However,
the functions recieving the array's values compalin of type mismatch. How do convert variant into string???

Thanks,
Serge
AutofreakAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
CStr(Variant)
0
 
JackOfPHConnect With a Mentor Commented:
dim x
dim y as string

y = cstr(x)
0
 
alainbrydenConnect With a Mentor Commented:
you should probably check just to be sure:

Dim x as integer
Dim StrResult As String
Dim VarArray() As Variant
...
...
If isAlphaNumeric( VarArray(x) ) then
   StrResult = CStr( VarArray(x) )
Else
   StrResult = vbNullString
End If
0
 
kaliyugkaarjunConnect With a Mentor Commented:
I think u need to loop through the variant and for each item in a variant (i.e. variant_array_name(0), variant_array_name(1),.....) use function cstr() to convert it to string...

0
 
AutofreakAuthor Commented:
Thank you Guys, all answeres halped me.
Serge
0
All Courses

From novice to tech pro — start learning today.