+ Reply to Thread
Results 1 to 3 of 3

Hitting return key, linked to a button

  1. #1
    Registered User
    Join Date
    09-15-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    10

    Hitting return key, linked to a button

    I have a search setup in an excel sheet. Simply, I want to be able to hit the enter key and then it would automatically perform the function dedicated the button within the excel sheet.

    Example: I type in 'Cat' and hit enter, it will use the code for the search button I created. So instead of clicking the search button, the enter key will act as if I did.

    Do you know the code for that?

    Thank you in advance.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Hitting return key, linked to a button

    I've never done this before but see if this works.

    1. Modify your macro so that it brings in a string value. Something like this
    Please Login or Register  to view this content.
    Then set TestVal to whatever variable your macro searches for.

    2. In the spreadsheet where you are entering your values, enter the code
    Please Login or Register  to view this content.
    Try this and see if it works for you.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-15-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Hitting return key, linked to a button

    I tried your code, I'm making it more complicated than it should be. Maybe you can help.

    Thanks in advance.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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