+ Reply to Thread
Results 1 to 5 of 5

trying to get the RETURN key to behave like the TAB

  1. #1
    Registered User
    Join Date
    12-17-2003
    Posts
    6

    trying to get the RETURN key to behave like the TAB

    hi all

    been looked around for a bit now and can't seem to find an answer to my problem.
    I have a spreadsheet which I'll be using to do some data entry

    is there a way to get the RETURN key to behave like the TAB key?
    in other words when they hit RETURN it would bring them to the cell directly next to it rather than the cell below (default)?

    if there's a way to set that on the Vb side that would be nice since I would like that feature turned on or off depending what sheet they are on

    thanks

    Pabs

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: trying to get the RETURN key to behave like the TAB

    Good evening pabs

    You could use OnKey to detect the Carriage Return key (note : this is the main carriage return key - not the numeric keyboard Enter key) and when it is detected, use SendKeys to send the tab to Excel. The code below has two macros, TurnOn and TurnOff.
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    12-17-2003
    Posts
    6

    Re: trying to get the RETURN key to behave like the TAB

    rock and roll! that's works well!
    thanks

    quick question on the subject.
    within the same macro (TurOn) can I do this

    Please Login or Register  to view this content.
    nopaste is a local sub (simple pop up warning)


    there is nothing wrong with calling multiple instances of the Application.Key correct?
    it works but I'm just wondering if it won't create strange bugs..

    one thing I don't get is the turn off macro.
    you simply call
    Please Login or Register  to view this content.
    what does that do? cause it's not linking it to anything . or does it simply say return "~" to it's default?

    if that's the case I would need to do something like this correct?
    Please Login or Register  to view this content.

    thanks again

    Pabs

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: trying to get the RETURN key to behave like the TAB

    Hi pabs
    Quote Originally Posted by pabs View Post
    there is nothing wrong with calling multiple instances of the Application.Key correct?
    it works but I'm just wondering if it won't create strange bugs..
    You should be OK to call multiple instance of OnKey - just remember to turn them all off when you no longer need them.
    Quote Originally Posted by pabs View Post
    or does it simply say return "~" to it's default?
    if that's the case I would need to do something like this correct?
    Correct - the tilde sign (~) when used in this instance represents the carriage return key.

    HTH

    DominicB

  5. #5
    Registered User
    Join Date
    12-17-2003
    Posts
    6

    Re: trying to get the RETURN key to behave like the TAB

    thanks for the help dominic...

+ 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