Consulting

Results 1 to 3 of 3

Thread: Dynamicly Fill Listbox with column headers?

  1. #1

    Dynamicly Fill Listbox with column headers?

    Hello,

    I am trying to fill a listbox on a userform with column headers, but I want it to be dynamic so that no matter how many column headers there are it won't be hard coded to a particular range.

    Any help or suggestions would be greatly appreciated!

    Andy

  2. #2
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    [vba] Dim cell As Range
    For Each cell In Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft))
    ListBox.AddItem cell.Value
    Next cell[/vba]

  3. #3

    Thumbs up

    Thanks tpoynton,

    That works perfectly!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •