+ Reply to Thread
Results 1 to 7 of 7

column heads in excel vba

  1. #1
    Registered User
    Join Date
    06-11-2008
    Posts
    4

    column heads in excel vba

    Im trying to add coloumn heads to my listbox but its just not working
    i was using rowsource to use the first row of the sheet as the headings however this just set the values in the listbox to the rowsource

    Here is my code

    Please Login or Register  to view this content.
    Any help would be much appreciated

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Not sure what your code is doing, but have you set the ListBox's ColumnHead Property to True?

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-11-2008
    Posts
    4
    I use the following code

    Please Login or Register  to view this content.

    But this just puts row 1 in the listbox and not the values i want to display under the headings

    How can i use the headings from row A1 to H2 without wiping out the values i display in the listbox?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Cheers
    Andy
    www.andypope.info

  6. #6
    Registered User
    Join Date
    06-11-2008
    Posts
    4
    it's throwing an error

    "wrong number of arguments or invalid assignment"

    i dont really understand the rowsource line of code so i cant see where it's going wrong

    thanks so much for the help

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Sorry there was a typo, corrected now.

    Please make sure to read the rules about cross posing.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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