+ Reply to Thread
Results 1 to 4 of 4

VBA Setfocus to next textbox

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    VBA Setfocus to next textbox

    Hi All,

    I have been looking around but unable to get this to work correctly. I have a userform with a combobox and a textbox. Currently it is set to setfocus on the combobox when the userform is opened. What I would like to do....After the combobox selection has been made (from a dropdown), setfocus is automatically shifted to the textbox. It seems simple enough, but every example I have tried so far, hasn't worked out. Help is appreciated.

    Thank you,
    Patrick

  2. #2
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    Excel 2016
    Posts
    319

    Re: VBA Setfocus to next textbox

    What if they don't use the dropdown in the ComboBox?
    you can use an on change trigger but it would go off when character is typed in.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: VBA Setfocus to next textbox

    Hi Leon,

    I am encouraging the users of the form to utilize the dropdowns to prevent other issues down the line. This is just the 1st stop in a longer process. Other sheets will be opened and or populated partly based on the names listed in the dropdown. So with that in mind, I am trying to keep this as fail free as possible.

    For the 1st part I am using this code:

    Please Login or Register  to view this content.
    So, after the user picks from the list, I would like the focus to shift to a text box called TB_Logon. I need nothing other than to get the flashing cursor to move from CMB_Lead to TB_logon. I would prefer that it happen without the user having to tab or enter if possible.

  4. #4
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    Excel 2016
    Posts
    319

    Re: VBA Setfocus to next textbox

    Please Login or Register  to view this content.
    will move to the text box when the value in combobox 1 (replace with your box name) changes. however if users try to type manualy it will move to the text box after the first character is typed in.

+ 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. difficulty with SetFocus in data validation for textbox
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2008, 06:06 PM
  2. TextBox.SetFocus not working
    By vesoljc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-11-2007, 01:49 AM
  3. [SOLVED] Having problems with textbox setfocus
    By Terry K in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 09:30 AM
  4. setfocus in textbox on multipage
    By Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2006, 12:25 AM
  5. [SOLVED] textbox setfocus and select current contents
    By rcmodelr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2005, 09:05 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