troubleshooting Question

Add column header in Excel list box

Avatar of AXISHK
AXISHK asked on
Visual Basic ClassicMicrosoft Excel
1 Comment1 Solution449 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros