+ Reply to Thread
Results 1 to 4 of 4

Set focus on textbox and write incremental value with every button click

  1. #1
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Set focus on textbox and write incremental value with every button click

    Hi,

    I have 7 textboxes on a userform and a button. Button suppose to place an incremental value to the textbox with every click. But as I mentioned, there are 7 textboxes. The aim is:
    • User selcts ANY of 7 textboxes
    • User clicks the button
    • The value in a textbox, which was selected, changes to 1
    • With every further click the value in the same textbox increases by 1

    How do I go about it?

    Thanks in advance for your priceless help!

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Set focus on textbox and write incremental value with every button click

    Code below from the example attached will do this.
    Please Login or Register  to view this content.
    Note, I've set the command button's TakeFocusOnClick property to FALSE

    BSB
    Attached Files Attached Files

  3. #3
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Set focus on textbox and write incremental value with every button click

    Ah, learning something every day... I didn't know how to keep focus on the textbox while clicking the button. Brilliant, solved!

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Set focus on textbox and write incremental value with every button click

    Glad I could help in your learning

    BSB

+ 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. userform how to set focus on textbox1 when click "AB" button.
    By [kinder] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2018, 04:01 AM
  2. Userform - Click a button, open browser and go to URL from textbox
    By stevefisher85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2016, 07:56 AM
  3. [SOLVED] Click button and freeze time textbox
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-01-2016, 01:32 PM
  4. Change textbox text with button click procedure
    By akotronis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2014, 09:26 AM
  5. Userform Minimize Button Code Blocking Focus for First TextBox in Frame
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-14-2014, 12:57 PM
  6. Option button click ... then focus back to sheet ?
    By dannac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 02:05 AM
  7. setting focus with click of command button
    By shakey775 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-28-2012, 01:38 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