+ Reply to Thread
Results 1 to 5 of 5

SetFocus on a Userform TextBox

  1. #1
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    SetFocus on a Userform TextBox

    I have an userform (UserForm1) with multiple textboxes. I can't seem to set focus on any of them using .SetFocus

    For example:
    Please Login or Register  to view this content.
    does nothing, although there is a TextBox with the name "OptionMatchScore" on the userform.
    Any idea about what I might be doing wrong? TY.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: SetFocus on a Userform TextBox

    Without seeing the rest of the code which might be a clue, it's hard to say.
    With that we could see if it's triggered by a command button or a userform event, etc.

    Also this is an odd name for a text box, seems more like a name you would give an option button.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: SetFocus on a Userform TextBox

    Hi bibu

    What's the rest of the Code look like?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: SetFocus on a Userform TextBox

    I'm sorry for the delay, and thank you for the replies. I've solved this (not sure what the issue was - actually I know, I was too sleepy and tired). Now I gave it another go and .SetFocus worked, so thanks for trying to help!

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: SetFocus on a Userform TextBox

    Glad you got it sorted.

+ 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] SetFocus not working on TextBox after AfterUpdate
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-26-2022, 07:15 PM
  2. [SOLVED] Unable to setfocus on my textbox
    By JPGraphX in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-18-2014, 09:54 AM
  3. VBA Setfocus to next textbox
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2013, 12:47 PM
  4. TextBox.SetFocus not working
    By vesoljc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-11-2007, 01:49 AM
  5. Having problems with textbox setfocus
    By Terry K in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 09:30 AM
  6. [SOLVED] setfocus in textbox on multipage
    By Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2006, 12:25 AM
  7. 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