+ Reply to Thread
Results 1 to 3 of 3

Assign 2 different values/behaviours to a key

  1. #1
    Forum Contributor
    Join Date
    08-02-2007
    Location
    Panama & Austria
    MS-Off Ver
    2003 & 2010
    Posts
    186

    Assign 2 different values/behaviours to a key

    Hi,
    I need to give 2 different behaviours to the {ENTER} key. If the {ENTER} key is pressed on sheet "Test", it should pop out a msgBox. Everywere else it should act as a normal {ENTER} key.

    So far I used the following code to catch up when enter is pressed.
    Please Login or Register  to view this content.
    On the procedure "myEnterBehaviour" I check the worksheet name and then take an action. Poping Up the msgBox is no problem; my problem is making it act normal ! How can I Achieve that?

    My Code so Far:

    Please Login or Register  to view this content.
    Thanks !

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Assign 2 different values/behaviours to a key

    Try to put this code only in "Test" sheet so it will call myEnterBehaviour sub only for that sheet
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Forum Contributor
    Join Date
    08-02-2007
    Location
    Panama & Austria
    MS-Off Ver
    2003 & 2010
    Posts
    186

    Re: Assign 2 different values/behaviours to a key

    Gracias Antonio !
    The problem with this approach is when the following happen

    1.Sheet "Test" activate
    2.User deactivate macros
    3.Moves to another sheet or workbook
    4.activate macros or run a macro throug a button.

    I was using that approach, but now I need something more 'user proof' !

+ 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