+ Reply to Thread
Results 1 to 10 of 10

Populate ComboBox

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Populate ComboBox

    Can someone tell me why the code below won't work to populate a ComboBox that I have on a userform named "TradingDashboard"?

    Please Login or Register  to view this content.
    Even better, let me in how it should be written?

    If it's not clear from my attempt, the ComboBox should contain two choices in the list. The row from the active cell of column F and the same again for column G.

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Populate ComboBox

    Change the sheetsname.

    Please Login or Register  to view this content.
    Or:
    Please Login or Register  to view this content.
    Harry.

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Populate ComboBox

    My ComboBox is on a userform named "TradingDashboard" not a worksheet.

    I therefore your code to
    Please Login or Register  to view this content.
    but when I try to run the code it comes up with a compile error "Method or Data Member not found" and highlights the code
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Populate ComboBox

    I know your userform is named "TradingDashboard"
    Do only what I write.
    The name of the Userform doesn't matter.
    Just the sheetname does matter.

  5. #5
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Populate ComboBox

    ok. I might seem really thick now but the sheet name of the active cells is called "Coupon". What do I amend?

  6. #6
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Populate ComboBox

    Please Login or Register  to view this content.

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

    Re: Populate ComboBox

    Try this.
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Populate ComboBox

    Me. = redundant in the code.

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

    Re: Populate ComboBox

    Harry

    I suppose With Sheets("") is redundant too, it's not needed as without a worksheet reference Cells and Range will refer to the active sheet.

  10. #10
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Populate ComboBox

    You're right Norie.

    Ps. Maybe this is a solution if the userform Initializes in which worksheet than also.
    Please Login or Register  to view this content.
    Last edited by HSV; 10-28-2012 at 01:31 PM. Reason: Ps.

+ 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