+ Reply to Thread
Results 1 to 3 of 3

Select text in textbox from commandbutton click event

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    60

    Select text in textbox from commandbutton click event

    I'm attempting to select the text in a textbox when an error is found while executing a commandbutton click event. The following code works great at highlighting the background of the textbox where the error was and also focuses on the textbox...

    What I'd like to do, if possible, is to select that text so that the user sees what he already answered and just has to type over it without taking out the previously entered text. I know I could set the textbox back to "" but I do want the user to see what he had entered previously. I've looked in the Properties window and don't see anything that might do that.

    Please Login or Register  to view this content.
    RGB2 is set an RGB number (orange red). There are several of these tests in the procedure but only posted one.

    Might be asking for something that can't be done, but won't know until the guru's tell me it can't done.....

    TIA

    Don

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Select text in textbox from commandbutton click event

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Select text in textbox from commandbutton click event

    Thanks for the very quick response. I plugged your code in to all the test and it worked exactly like I wanted it to...very much appreciated!

    Don

+ 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] Get Caption From Userform CommandButton During Click Event Procedure
    By skywriter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2015, 02:53 AM
  2. Call a commandbutton click event from a module
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2015, 01:10 PM
  3. [SOLVED] Mulitple textbox click event
    By Journeyman3000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2013, 07:17 PM
  4. Stop exit event of textbox firing when click a command button to close a userform
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2013, 09:27 AM
  5. [SOLVED] Is it possible to have a command button click event autofill a textbox within a userform?
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2012, 02:14 PM
  6. On the click event of commandbutton open another excel workbook
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2010, 06:28 AM
  7. [SOLVED] Select Multi in Listbox -> Event Click not working
    By François in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2006, 05:00 PM

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