+ Reply to Thread
Results 1 to 4 of 4

Is it possible to have a command button click event autofill a textbox within a userform?

  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Is it possible to have a command button click event autofill a textbox within a userform?

    I'm attempting to use a command button to autofill a text box (both within the same userform) with a value. I'd also like to add functionality to allow for toggling to remove the value the command button entered in the first time. The command button click would also disable input into the text box unless the command button is clicked again. I just happen to be stuck on the very first part of this issue.

    Here's the code I was attempting to use but alas, no joy: (Command Button name is N/A and TexBox name is A1). I've attached a sample to make it easier.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated. Thanks in advance!

    -Orestees
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Is it possible to have a command button click event autofill a textbox within a userfo

    First, replace the CommandButton NA1 with a ToggleButton. Then use this code, and let me know if it helps.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Is it possible to have a command button click event autofill a textbox within a userfo

    Just Use this:

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  4. #4
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Is it possible to have a command button click event autofill a textbox within a userfo

    BigBas, you rock! That was a very fast solution and you made it look so easy. Thanks a TON!

    -Orestees

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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