View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default how to redim the type of variant element

Just change the data type to String

Dim myDyn() As String


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"lvcha.gouqizi" wrote in message
oups.com...
Hi there,

I define a dynamic array as
Dim myDyn() as Variant

Is there any way to redim its element type as String?

The reason that I need to do this is because when I pass
myDyn(1) to a
function whose parameter is String, it reports "ByRef argument
type
mismatch". I am wondering if this is the reason.

Any other suggestion to avoid this bug report?

Thank,
lvcha