+ Reply to Thread
Results 1 to 7 of 7

Populating ComboBox

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Populating ComboBox

    I got a row in rangaes A1: A10

    I assume that I do not know where it ends and I would like to transfer these values into a combobox and dont need to worry about Unique Values. Am I right in using the do while loops (or do loop untils)

    Please Login or Register  to view this content.
    The thing is, its not working though, Thanks in Advance!
    Last edited by alansidman; 09-21-2013 at 08:19 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Populating ComboBox

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added the code tags, but in the future, please pay attention and adhere to our rules.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Populating ComboBox

    Hi, dinosaur1993,

    no matter how your form is called the procedure is called UserForm_Initialize for all of them.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Populating ComboBox

    oh sorry! My apologies!

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Populating ComboBox

    Although Holger didn't explicitly mention it, he also fixed another problem in your code that is typically a result of using code generated by the macro recorder. It is not necessary to Activate and Select anything that you need to refer to. If you do, Excel physically moves the cursor around and this can be disconcerting to a user and take a lot of extra time in large operations. Holger has shown how to refer to a cell without selecting it.

    There is a brief article here on the subject.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  6. #6
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Populating ComboBox

    Thank you! so its always better to use a count rather than selecting the activecell and moving around the cursor yeah?

    Kind Regards,
    dinosaur1993

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Populating ComboBox

    Hi, dinosaur1993,

    for sure. With the code supplied you would even not need the sheet you rely on to be the active one.

    Ciao,
    Holger

+ 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. Populating combobox 2 with items that match criteria from combobox 1
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-13-2013, 03:00 AM
  2. Removing Duplicates from ComboBox and Populating one combobox based on another
    By kbmtech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2010, 11:17 PM
  3. Populating the list in a combobox based off the value chosen in another combobox
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2010, 11:50 AM
  4. (De)Populating combobox
    By panthers7171 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2009, 06:53 PM
  5. combobox populating
    By burgerboy2k6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2007, 08:58 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