+ Reply to Thread
Results 1 to 11 of 11

textbox1 * textbox2 = textbox3

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    textbox1 * textbox2 = textbox3

    hi
    i have had this previously , but has completely gone think its age ,
    i have a userform with numerous text boxes , some are copies so only interested in these 3
    tbox1 * tbox2 - tbox 3 ,
    as i entered £50 in tb1
    entered 2in tb2
    tb3 was populated automatically
    have tried different versions of this got it once doin me head in now also have populated a userform with a combobox which works but for the life of me cannot get it to populate a textbox1 with data
    the combo box pops with 500ton row a and textbox should pop with value in row e
    any takers please
    as per previous threads im 56 too and its showing have uploaded cranes it is code for userform 1 you will have to go to developer , vb , userform1 and code to view as not userform1.show till got it right
    cheers colin

    [Private Sub TextBox3_Change()
    If TextBox1.Value = "" Then Exit Sub
    If TextBox2.Value = "" Then Exit Sub
    TextBox3.Value = CDbl(TextBox1.Value) * CDbl(TextBox2.Value)
    End Sub]
    Attached Files Attached Files
    Last edited by cfinch100; 12-23-2012 at 01:59 PM. Reason: solved

  2. #2
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    hi
    have now got this that works but need it to be in £ s sterling and not numbers as is with this code , ws is in £s

    [Private Sub TextBox1_Change()
    If TextBox1.Value = "" Then Exit Sub
    If TextBox2.Value = "" Then Exit Sub
    TextBox3.Value = CDbl(TextBox1.Value) - CDbl(TextBox2.Value)
    End Sub ]

    [Private Sub TextBox2_Change()
    If TextBox1.Value = "" Then Exit Sub
    If TextBox2.Value = "" Then Exit Sub
    TextBox3.Value = CDbl(TextBox1.Value) - CDbl(TextBox2.Value)
    End Sub]
    hope this helps any else struggling
    colin

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    You can use Format.
    Please Login or Register  to view this content.
    PS Please use 'real' code tags.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    hi
    says expected end of statement any ideas
    colin

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: textbox1 * textbox2 = textbox3

    Colin

    Did you copy what I posted exactly as it is?

  6. #6
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    hi norie
    yes just redone copied and paste this time no error i forgot the word format
    but has not changed just numbers still
    cheers colin

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: textbox1 * textbox2 = textbox3

    Where did you put the code?

  8. #8
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    textbox1 and textbox2 where original code was what i put in actually im using 25 and 32 and
    39 but 1,2,3 tb will do i can fcheersigure it out from them
    cheers col

  9. #9
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    many thanks again norie found my mistake
    cheers

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: textbox1 * textbox2 = textbox3

    Colin

    Care to share what it was, it is Christmas after all.

  11. #11
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: textbox1 * textbox2 = textbox3

    hi
    yes sorry the code you gave me worked perfect if put into the right textbox, i originally put it in textbox1 and 2 but should have been put into textbox3 the total textbox
    textbox1- textbox2=textbox3 easy when you think of me thinks
    thanks for help again prob wont be the last i would think watch this space
    many thanks
    colin

+ 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