
Calling function or sub with variable array or string names
Dawid
could be that your Function is getting confused. I think the word "Name"
may be reserved by Excel/VBA. For example,
Name OldName As NewName ' Rename file.
Try changing the name of your variables/parameters to something else.
Regards
Trevor
Quote:
> Hello
> I'm having problems of passing a string( ) or array with different
> names to a function
> I have a Function that uses a Name( ) as String component. I want to
> call this function but change the string name as desired.
> eg
> Dim Test1( ) as String
> Dim Test2 ( ) as String
> Function DoThis(Name( ) as String)
> .....
> y= Name(i)
> End Sub
> When I call the function with DoThis(Test1) or DoThis(Test1( ) ) I get a
> mismatch error
> Appreciate if somebody what silly mistake I'm making
> Thanks