+ Reply to Thread
Results 1 to 7 of 7

St Focus on a TextBox

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    St Focus on a TextBox

    Hello,
    I am trying to run a command which would set focus on a TextBox called "SummaryFilter" so I could type into the box immediately without manually selecting / clicking into it.

    This is what I am trying to do:
    Please Login or Register  to view this content.
    but it returns an error.

    Could you please advise?

    Thanks

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: St Focus on a TextBox

    WHat kind of text box is this? On a userform?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: St Focus on a TextBox

    I added the textbox to the worksheet through Excel's Menu bar by clicking:
    Insert/ActiveX Controls/Text Box

    FYI
    Thanks

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: St Focus on a TextBox

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: St Focus on a TextBox

    Thank you sintek, it works!

  6. #6
    Registered User
    Join Date
    03-22-2024
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    1

    Re: St Focus on a TextBox

    Not very elegant, but this worked for me. Instead of using TextBox1.SetFocus, I called this sub:

    Private Sub resetfocus()
    TextBox2.SetFocus
    TextBox1.SetFocus
    End Sub

    Apparently it is a timing issue.

  7. #7
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: St Focus on a TextBox

    Thank you!

+ 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] keep focus on textbox
    By HarryKlein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2019, 10:51 AM
  2. [SOLVED] Textbox doesnt automatically regain focus until textbox entered
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-12-2019, 12:35 PM
  3. [SOLVED] Pressing Enter on Textbox moves focus to next Textbox
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-11-2016, 09:37 AM
  4. textbox without focus
    By eugz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2014, 04:24 PM
  5. Focus on Textbox
    By seemanthv in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2014, 02:38 AM
  6. [SOLVED] Textbox focus
    By tradinup2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2013, 12:25 AM
  7. How to tell what textbox got the focus
    By vqthomf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2005, 09:15 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