excel vba get column name from number get all column names from excel vba

The solution for “excel vba get column name from number get all column names from excel vba” can be found here. The following code will assist you in solving the problem.

‘For column number 256…

ColName = Split(Cells(, 256).Address, “$”)(1)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

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts