+ Reply to Thread
Results 1 to 8 of 8

How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

  1. #1
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    So i have 9 textboxes in a userform that is in a 3x3 format, the textboxes in my userform are positioned as follows:

    textbox1 textbox2 textbox3
    textbox4 textbox5 textbox6
    textbox7 textbox8 textbox9


    How do i make so like for example i click textbox5, and i press an arrow key, it will jump to the textbox where it is located like
    up key = textbox2
    down key = textbox 8
    right key = textbox6
    left key = textbox4

    how do i do this?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Up and Down arrow do it nicely


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Quote Originally Posted by :) Sixthsense :) View Post
    Up and Down arrow do it nicely
    are you being sarcastic because i did something wrong in the format of my thread? If so I apologize.

    If you're not being sarcastic though, up and down arrows doesnt do it.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Set the Tab order according to your need.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Hi,m :) Sixthsense :)

    waiting for your example for Textbox1 and Textbox9...

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Quote Originally Posted by HaHoBe View Post
    waiting for your example for Textbox1 and Textbox9...
    ....................................
    Attached Files Attached Files

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    Hi, :) Sixthsense :)

    thanks for your sample - I certainly would never have been able to do it.

    Besides I think we understood the sample given by TO quite diffferently. The original was with the active TB being the middle one (TB5). Your solution will work with some limitations as only up and down key work until they reach the border (which is fine for the sample given) while left and right key on my Excel wonīt.

    Letīs take TB6 and check there. No problem for up, down and left but maybe about right as TB6 is on the far right side of the Form. From what I understood it would have been TB 4 for the right key while using the TAB order it could have been TB7. Same with TB9. Left and up key donīt present any problem but right could be TB7 and down TB3.

    Anyhow: OP has to be more specific about what is wanted for the border TBs or if any action is wanted there at all.

    Ciao,
    Holger

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to move the textbox cursor from textbox1 to textbox2 using the arrow key?

    May be OP should go for application.OnKey method

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform Textbox1 = Val(Textbox2.Value) / 2
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2013, 09:37 AM
  2. [SOLVED] Cell Value = TextBox1.Value + TextBox2.Value
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2013, 09:30 AM
  3. [SOLVED] textbox1 * textbox2 = textbox3
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-23-2012, 03:35 PM
  4. Choose 4 Random Numbers if they are not textbox1 or textbox2
    By blitz74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2012, 02:41 AM
  5. [SOLVED] TextBox1 = TextBox2
    By Anto_BT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 03:34 AM

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