如何使用VBA中的逗號分隔符將列表框中的所有項目傳遞給單個單元格?VBA Excel使用列表框項目填充單元格
這是我當前的代碼,我將每個項目傳遞給一個數組,然後將單元格值設置爲數組,但它不起作用。
Dim histReturn() As Long
Dim j As Integer
For j = 0 To Me.history_lbx.ListCount - 1
ReDim Preserve histReturn(j)
Dim x As Variant
For Each x In histReturn
Cells(i, 4).Value = Cells(i, 4).Value & x & ", "
Next x
明白了,謝謝你的解釋。 – webhead