+ Reply to Thread
Results 1 to 9 of 9

TextBox in UserForm to show cell value instantly

  1. #1
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    TextBox in UserForm to show cell value instantly

    I have two TextBoxes (txtSpan & txtTrib) in a UserForm (frmSizes), when values are entered in these TextBoxes they show (as they are typed) in cells of the spreadsheet. The resulting calculation is in cell B11.

    How do I get the value in cell B11 to show in a third TextBox (txtAns) as soon as it is calculated without closing the UserForm or running another code?

    Thanks Sandy
    Last edited by gsandy; 11-03-2009 at 09:33 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: TextBox in UserForm to show cell value instantly

    if you have used the control source proptie on the textbox's it textbox will update automatically on the exit event of the 1st two texoboxes

    ot in other words set the trd textbox control source to B11


  3. #3
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: TextBox in UserForm to show cell value instantly

    I thought if I did that then if anyone types anything in the third TextBox it would overwrite the formulas in the linked cell?

    Thanks Sandy

  4. #4
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: TextBox in UserForm to show cell value instantly

    true though if the purpose of the txbox is to display results could you not set the enabales to false

    actially you can not set the enabled to false else the data will not update
    try setfocus
    Please Login or Register  to view this content.
    Last edited by D_Rennie; 11-03-2009 at 06:25 PM.

  5. #5
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: TextBox in UserForm to show cell value instantly

    Did that, and whether enabled is set to true or false, the formula in the cell is overwritten when I start entering values in the first two TextBoxes (there are no links in theses two TextBoxes)??

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: TextBox in UserForm to show cell value instantly

    Hello Gsandy,

    The attached file should help. It uses three text boxes to sum 2 values and display the results in the third. All values are shown in cells "A1:C1".
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: TextBox in UserForm to show cell value instantly

    Hi Leith,

    The problem with your solution is that you have the calculation within "ShowSum". The answer showing in my cell B11 comes from quite complex spreadsheet calculations and I dont think I can do this within VBA.

    Is my best solution to have a "Calculate" command button that refreshes the form to show B11's cell value?

    Thanks Sandy

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: TextBox in UserForm to show cell value instantly

    Hello Gsandy,

    The button might be the way to go. With so little information about the layout, data, formulas, and VBA code, I can't give you an definitive answer.

  9. #9
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: TextBox in UserForm to show cell value instantly

    Thanks for trying leith. Sandy

+ 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