+ Reply to Thread
Results 1 to 3 of 3

How to keep updated textbox on user form

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Wilmingotn DE USA
    MS-Off Ver
    Excel 2016
    Posts
    67

    Lightbulb How to keep updated textbox on user form

    Dear Sirs. Hope general description will be enough. My problem: I have a user form with few cbboxes. All cbboxes are connected to certain cells listed as source control in each cbbox property. Somewhere in excel spreadsheet, some simple calculation is done based on values in those cells and I want to show the result on the same user form for example in dedicated text box. It works only one time, in order to see newer result caused by changing value in one of the cbboxes I have to close user form and open again. Is is possible to see immediately results based on calculation which is using actual values from cbboxes without closing and reopening user form?

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

    Re: How to keep updated textbox on user form

    Hi

    This is possible.

    I created a userform with a text box.

    On activation the text box picks up the value of H1.

    The userform is modeless so you can move it around and modify the spreadsheet with the user form open.

    Finally.

    If you modify the spreadsheet the textbox is automatically updated.

    To see that code right click on the sheet name at the bottom of excel and select view code.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Wilmingotn DE USA
    MS-Off Ver
    Excel 2016
    Posts
    67

    Re: How to keep updated textbox on user form

    Dear Mehmetcik
    Thanks for your time but my problem is still unsolved. I tried modeless user form and it did not help. Let me be little bit more specific. My user form has 4 cb boxes. Each cb box is used to chose number; cb box#1 represents hours the cbbox#2 represent minutes of the beginning of the event. Another two cb boxes are used also to enter time , cb box #3 hours and cbbox#4 minutes the end of event. Each cbbox has its own assigned control source cell. User form has also a text box which has to show the time duration of the event. Lets say cell "H5" has the value of duration time. Time which was calculated based on values stored in source control cells assigned to each cb box. The TextBox.value=range("H5").value does not work. What I need, I need TextBox to show immediately changes caused by changing values in any of the cbboxes. Honestly it works but not always, sometimes duration time is changed but those changes are not correct. Means TextBox will show me e.g. 5:15 (5 hours 15 minutes) while cell H5 is for instance 5:20 . But it was 5:15 some time ago when I was doing other changes. Briefly, TextBox value is sometimes changing but I can not figure out how this mechanism works. Please help.
    Flowerski

    Quote Originally Posted by mehmetcik View Post
    Hi

    This is possible.

    I created a userform with a text box.

    On activation the text box picks up the value of H1.

    The userform is modeless so you can move it around and modify the spreadsheet with the user form open.

    Finally.

    If you modify the spreadsheet the textbox is automatically updated.

    To see that code right click on the sheet name at the bottom of excel and select view code.

+ 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] textbox in a user form
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2013, 05:18 AM
  2. [SOLVED] Value entered thr User form should be checked for existance and updated accordingly
    By vignesh805 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2013, 04:23 AM
  3. vba excel user form restrict input on user textbox
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 04:38 PM
  4. [SOLVED] textbox on user form
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2005, 12:45 PM
  5. User Form in VB = TextBox
    By Kel in forum Excel General
    Replies: 1
    Last Post: 08-10-2005, 08:05 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