Closed Thread
Results 1 to 2 of 2

how to populate listbox with named range

  1. #1
    Registered User
    Join Date
    03-21-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    how to populate listbox with named range

    Hello Everyone,

    Plz help me with the attached spreadsheet. inside the spreadsheet there is a dynamic chart that changes the view by selection made in listbox on userform. this code actually used dialog box that is no longer supported in 2003/2007. I want to create similiar code n chart in 2003 n 2007.

    When i try to populate listbox1 on userform i write

    dim range2 as range

    set range2 = range("b8:f8") &""& range("b9:f9")

    with listbox1
    .rowsource = range2

    I am looking to use named range to populate data in listbox so when someone uses the range2 in chart source type, we have to mention just range2 and inside range2 it contains different range like (b8:f8) (b9:f9) (b10:f10) n all these different ranges are listed in listbox as revenue(b8:f8) cost(b9:f9) total cost(b10:f10) so when i select revenue from listbox chart range will select range2 (b8:f8) likewise. Please help me.
    Attached Files Attached Files

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: how to populate listbox with named range

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

Closed 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