+ Reply to Thread
Results 1 to 3 of 3

Userform Listbox Column headers from recordset or array?

  1. #1
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Userform Listbox Column headers from recordset or array?

    Is it possible to populate the Listbox column headers coming from recordset or array and not from range from excel spreadsheet?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform Listbox Column headers from recordset or array?

    Sorry but the answer is no, the only way you can have 'real' headers is if you populate from a range.

    There are a number of workarounds though, for example you could create a set of small labels just above the listbox for the headers.

    Or, and this is kind of my favourite, create a one row listbox positioned just above the listbox with the data.

    This listbox would have the same column widths as the main one and it's one row would be populated with the headers.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Userform Listbox Column headers from recordset or array?

    Thanks Norie for your answer. Actually, there are 30 columns that i would populate in the listbox. Small labels seems not fitted for this since listbox will create a 'scroll' and the labels would not follow. Also for creating one row listbox, since it will create a new scroll right?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] "Custom" entry of column headers for a userform listbox?
    By CaptainK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2014, 09:41 AM
  2. [SOLVED] listbox with column headers as a specific sheet column headers
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2014, 04:40 AM
  3. Populate VBA Userform Listbox using SQL Recordset
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 06:48 PM
  4. [SOLVED] Listbox column headers when data is collected in an array
    By evertjvr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 09:44 PM
  5. Replies: 2
    Last Post: 05-09-2012, 01:30 PM
  6. Problem displaying single record in userform listbox from recordset
    By carpking in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2009, 03:24 AM
  7. [SOLVED] Populating a multi column listbox with ADO Recordset
    By Paul Faulkner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2005, 03:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1