Forum Discussion
hrh_dash
Jun 26, 2022Iron Contributor
Error showing Expected Array for VBA to name file name in column
I would like to name Range("A1") as May22 which can be extracted from the filename. However when the code was executed, error message was triggered: Expected Array. Sub copyfilename ()
Dim ws ...
- Jun 26, 2022
Change the declaration of columnName to
Dim columnName() As StringThe () make columnName an array.
HansVogelaar
Jun 26, 2022MVP
Change the declaration of columnName to
Dim columnName() As String
The () make columnName an array.
hrh_dash
Jun 28, 2022Iron Contributor
thanks and appreciate the help!