In a program I’ve been working on, I had a subroutine that had a string array as a parameter.
Sub mySubroutine(ByRef inArray As Variant)
Originally, I had the above line as Sub mySubroutine(ByRef inArray As String)
but I kept getting compile errors until I changed it over to As Variant
Is this caused by having to pass by reference? What datatype should I have used for this situation?
New contributor
jsgv is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.