Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default textbox codes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default textbox codes

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight all Text in a Textbox when the textbox is selected RPIJG[_73_] Excel Programming 3 October 28th 05 08:28 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM
How to move cursor from one textbox control to another textbox con Tom Ogilvy Excel Programming 1 September 16th 04 03:42 PM


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"