Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have three TextBoxes
txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Change the names to your TextBox names With UserForm1 .TextBox3.Text = CDbl(.TextBox1.Text) * _ CDbl(.TextBox2.Text) End With -- Regards Ron de Bruin http://www.rondebruin.nl "tindatrue" wrote in message ... i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub txtPrice_Exit(ByVal Cancel As MSForms.ReturnBoolean)
On Error Resume Next txtTotal.Text = txtPrice.Text * txtQty.Text On Error GoTo 0 End Sub Private Sub txtQty_Exit(ByVal Cancel As MSForms.ReturnBoolean) On Error Resume Next txtTotal.Text = txtPrice.Text * txtQty.Text On Error GoTo 0 End Sub -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "tindatrue" wrote in message ... i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for your reply,
kindly let me know where to put tese codes, there are many events in textBox, like change,dblClick etc etc ???? -- aaaaaaaa "Ron de Bruin" wrote: Try this Change the names to your TextBox names With UserForm1 .TextBox3.Text = CDbl(.TextBox1.Text) * _ CDbl(.TextBox2.Text) End With -- Regards Ron de Bruin http://www.rondebruin.nl "tindatrue" wrote in message ... i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
and just adding to the bob's suggestion, if you want the total to change on
every number entry without leaving the textbox. Private Sub txtPrice_Change() On Error Resume Next txtTotal.Text = txtPrice.Text * txtQty.Text On Error GoTo 0 End Sub Private Sub txtQty_Change() On Error Resume Next txtTotal.Text = txtPrice.Text * txtQty.Text On Error GoTo 0 End Sub -- Gary "tindatrue" wrote in message ... i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See Bob's reply (Exit event)
You see that I use CDbl but in this case it is not needed but if you want to use textbox1 + testbox2 you must use it -- Regards Ron de Bruin http://www.rondebruin.nl "tindatrue" wrote in message ... Many thanks for your reply, kindly let me know where to put tese codes, there are many events in textBox, like change,dblClick etc etc ???? -- aaaaaaaa "Ron de Bruin" wrote: Try this Change the names to your TextBox names With UserForm1 .TextBox3.Text = CDbl(.TextBox1.Text) * _ CDbl(.TextBox2.Text) End With -- Regards Ron de Bruin http://www.rondebruin.nl "tindatrue" wrote in message ... i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many Thanks Ron
-- Neil "tindatrue" wrote: i have three TextBoxes txtPrice,txtQty and txtTotal i want codes for these textboxes,when a user put the price in txtPrice and Quantity in txtQty,the txtTotal wil automatically show the the value i.e. price*Qty=Total is there anyone who can help me thanks -- Neil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Highlight all Text in a Textbox when the textbox is selected | Excel Programming | |||
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming | |||
How to move cursor from one textbox control to another textbox con | Excel Programming |