+ Reply to Thread
Results 1 to 6 of 6

Userfom event

  1. #1
    Registered User
    Join Date
    10-19-2008
    Location
    UK
    Posts
    63

    Userfom event

    Hi,

    I have data in Sheet2 range A2:B11
    In column A I have countries in column B I have fruit.

    Example.

    France Apples
    Italy Apples
    France Berries
    Spain Cherries
    Guatemala Bananas
    Italy Pears
    France Grapes
    Italy Grapes
    France Pears
    Spain Apples


    I would like to create a Userform in Sheet1 where I put the name of a country and after clicking search command button on Userform this gives me list of fruit for that specific country. List of fruit should appear in Sheet1 starting from cell A1.

    I have no problem creating Userform but do not know how to trigger search event when I click command button on Userform.

    Thanks,
    Nix
    Last edited by nicolaforni; 09-05-2011 at 09:59 AM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Userfom event

    Please Login or Register  to view this content.

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

    Re: Userfom event

    Hi nicolaforni, I've attached a button that loads a user form and then does what you want (I think). Let me know how it goes.
    Attached Files Attached Files
    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---

  4. #4
    Registered User
    Join Date
    10-19-2008
    Location
    UK
    Posts
    63

    Thumbs up Re: Userfom event

    Great thanks!
    Nic

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Userfom event

    nicolaforni,

    Throwing in my 2 cents. For something this simple, a userform isn't requried. Essentially all you want is a drop-down list that returns results. Attached is an example workbook that does just that. I threw in some bells and whistles to make it fancy, but essentially, pick an item from the drop-down list in Sheet1 B1, and the results will be returned starting in B2. The code is in Worksheet_Change events and the drop-down list is a data-validation.

    Hope that helps,
    ~tigeravatar.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-19-2008
    Location
    UK
    Posts
    63

    Re: Userfom event

    Thanks tigeravatar that is also useful.

    Mordred one final thing how would I change code to show not the whole rows (eg. Italy Apples, Italy Pears etc.) but simply what is in a specific column for that country so in this case in column B?

    Thanks,
    Nix

+ 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