+ Reply to Thread
Results 1 to 2 of 2

Display result in userform (vba) textbox

  1. #1
    Registered User
    Join Date
    07-30-2009
    Location
    Vancouver, British Columbia
    MS-Off Ver
    Excel 2010
    Posts
    46

    Question Display result in userform (vba) textbox

    Hi,

    I'm trying to get a userform textbox to display the result of a formula from a cell.

    For example, cell A1=2 and cell B1=3. Cell C3=A1+B1, which displays 5. I have a textbox in a userform that displays the contents of cell C3, however it displays the formula, and not the result.

    How can I get the textbox to display the result?

    Any ideas

    - I Love Lagar -

    (PS. I actually love Guinness, which is a Stout, but "I Love Lagar" flows much better than "I Love Stout" )
    Last edited by ilovelagar; 09-21-2009 at 11:28 AM. Reason: Solved

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

    Re: Display result in userform (vba) textbox

    Hello ilovelagar,

    You must have recorded the macro. The default property for a Range object is the Value, which will be the result of a formula. The only way to get the formula into the TextBox is to use the Formula property.

    Example of Returning a Cell Value to a TextBox
    Please Login or Register  to view this content.
    Example of Returning theCell Formula to a TextBox
    Please Login or Register  to view this content.
    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!)

+ 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