我正在尝试将数组输出转换为字符串,以便以后进行操作和查看。
例如,我有一个数组{681120; 953160; 909420; 16300}。 我将如何将其转换为字符串?
答案 0 :(得分:0)
尝试:
Option Explicit
Sub ArrayLoop()
Dim ArrList As Variant
Dim ArrItem As Variant
Dim Result As String
ArrList = Array("681120", "953160", "909420", "16300")
Result = ""
For Each ArrItem In ArrList
If Result = "" Then
Result = ArrItem
Else: Result = Result & "_" & ArrItem
End If
Next
End Sub