Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 2 of 2

Thread: Reference a textbox in a formula that fills a different textbox

  1. #1
    Join Date
    14th April 2012
    Posts
    5

    Reference a textbox in a formula that fills a different textbox

    I have a textbox that I want to fill with a formula that references another text box on the same userform.
    This is what I have... but I want to have the number 11 be a variable so when I type in a value in Textbox1 then the formula will put the value of textbox1 in for the number "11"

    VB:
    Private Sub CommandButton5_Click() 
        TextBox2.Value = Evaluate("(11-(2*1.33))*2") 
    End Sub 
    
    
    Thanks
    Last edited by AAE; April 14th, 2012 at 07:40. Reason: add code tags

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,084

    Re: Reference a textbox in a formula that fills a different textbox

    Welcome to Ozgrid.

    Please learn to use code tags, which are required when posting VBA code.
    I've added them for you this time.

    VB:
    Private Sub CommandButton5_Click() 
        TextBox2.Value = Evaluate(TextBox1.Value - (2 * 1.33)) * 2 
    End Sub 
    
    
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Replies: 1
    Last Post: March 3rd, 2011, 11:33
  2. Replies: 2
    Last Post: December 6th, 2010, 13:04
  3. Insert textbox in chart and link textbox to cell
    By Don Link in forum EXCEL HELP
    Replies: 2
    Last Post: July 8th, 2010, 21:58
  4. Replies: 2
    Last Post: May 7th, 2008, 13:43
  5. Copy Textbox Text When Cursor Moved From Textbox
    By senarumugam2003 in forum EXCEL HELP
    Replies: 5
    Last Post: February 7th, 2007, 20:14

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
  •  
porno