+ Reply to Thread
Results 1 to 5 of 5

Based on userform combobox selection find text on worksheet

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    19

    Based on userform combobox selection find text on worksheet

    What i would like to happen:
    1- User clicks a command button and a userform "NewProject" opens - this is working fine. On userform there is a combobox a text box and a command button.
    2- User selects a word from a combobox on the userform, then enters text in the text box, then clicks the command button "submit" on userform.
    3- Userform closes, focus goes to cell containing matching text from userform combobox on active worksheet and inserts a row just below. Text from userform text box is inserted into cell "C" of new row of active worksheet.

    I have been working on this for quite a while now and can seem to get anything working, any help would be greatly appreciated.

    Paul

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Based on userform combobox selection find text on worksheet

    Hello there,

    Try the following code:

    Please Login or Register  to view this content.
    to insert the code:

    1. Open Visual Basic
    2. Select your userform and then right click on the submit command button and select view code.
    3. In between the Private Sub NameofYourcommandbutton_Click() and End Sub copy and paste the above code.
    4. Anything that appears in green is a comment meant to help you understand. You'll need to read through it so that you can adust the code to fit your needs.
    5. Close out of Visual Basic.

    Let me know if this works for you!

    Thanks!

  3. #3
    Registered User
    Join Date
    09-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Based on userform combobox selection find text on worksheet

    Works Great, Thank you so much. One small issue, the rows format is black fill with white text, how can i change this for the new inserted row to white fill black text.
    Thanks again!!

  4. #4
    Registered User
    Join Date
    09-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Based on userform combobox selection find text on worksheet

    I got it to work. Thanks so much once again.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Based on userform combobox selection find text on worksheet

    Sorry, just saw your second to last post! Glad you got it to work! Please don't forget to mark this thread SOLVED and maybe give a little star tap to add to my reputation points if I helped.

    Thanks!

+ 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