📜  从 excel vba 代码示例中获取所有列名

📅  最后修改于: 2022-03-11 14:51:57.252000             🧑  作者: Mango

代码示例2
Sub datacollect()
Dim heading() As String
Dim i As Integer
i = -1
For Each x In Rows(1).Cells
    If x.Value = "" Then Exit For
    i = i + 1
    ReDim Preserve heading(i) As String
    heading(i) = x.Value
Next x
End Sub