Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

Add column header in Excel list box

Any idea how to add the column header name with Excel VBA ?

  Dim strArray(2, 1) As Variant
    strArray(0, 0) = "Value 1"
    strArray(0, 1) = "Value 2"
    strArray(1, 0) = "Value 3"
    strArray(1, 1) = "Value 4"
    strArray(2, 0) = "Value 5"
    strArray(2, 1) = "Value 6"
     
    With ListBox2
        .ColumnCount = 2
        .List = strArray
        .ColumnHeads = True
   
    End With

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial