Hi all. I have simple question but couldn't solve it.
I want to return a Variant array with String data (Variant/String) into sheet, but it keeps being written as numeric in the sheet.
I could actually use text conversion function in sheet, but it would be great if the vba could return it as String directly.
Here is the code example:
Thank you in advance.
I want to return a Variant array with String data (Variant/String) into sheet, but it keeps being written as numeric in the sheet.
I could actually use text conversion function in sheet, but it would be great if the vba could return it as String directly.
Here is the code example:
VBA Code:
Sub trial()
Dim Data()
ReDim Data(1 To 2, 1 To 1)
Data(1, 1) = 1 'Integer
Data(2, 1) = "1" 'String
Range("A1:A2").Value = Data
End Sub
Thank you in advance.