-
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
-
[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]
-
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
-
Forum Rules