Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Multiply The Contents Of Two TextBoxes With The Result To Appear In A Third TextBox

Greetings,

I need to multiply the contents of TextBox1 with the contents of
TextBox2 and have the result show up in TextBox3. These three
TextBoxes are all on UserForm1.

I can't seem to get the syntax right. When I try to run any code It
kicks me into the debugger. Here is the code:

Private Sub TextBox1_Change()

SaveButton.Enabled = True
TextBox3.Value = (TextBox1.Value * TextBox2.Value) <<<<

End Sub

I also have it in TextBox2_Change()

The entry in TextBox1 is hours in decimal format and the entry in
TextBox2 is the rate in Dollars. All three TextBoxes have formatting
in an Exit event.

Any one see where I messed up?

TIA

-Minitman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Multiply The Contents Of Two TextBoxes With The Result To Appear In A Third TextBox

Try

TextBox3.Text = Cstr(CDbl(TextBox1.Text) * Cdbl(TextBox2.Text))

The CStr is just to be sure.

--

HTH

RP

"Minitman" wrote in message
...
Greetings,

I need to multiply the contents of TextBox1 with the contents of
TextBox2 and have the result show up in TextBox3. These three
TextBoxes are all on UserForm1.

I can't seem to get the syntax right. When I try to run any code It
kicks me into the debugger. Here is the code:

Private Sub TextBox1_Change()

SaveButton.Enabled = True
TextBox3.Value = (TextBox1.Value * TextBox2.Value) <<<<

End Sub

I also have it in TextBox2_Change()

The entry in TextBox1 is hours in decimal format and the entry in
TextBox2 is the rate in Dollars. All three TextBoxes have formatting
in an Exit event.

Any one see where I messed up?

TIA

-Minitman



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Multiply The Contents Of Two TextBoxes With The Result To Appear In A Third TextBox - Solved

Hey Bob,

That worked really well.

Thank you.

-Minitman



On Sun, 24 Oct 2004 00:17:53 +0100, "Bob Phillips"
wrote:

Try

TextBox3.Text = Cstr(CDbl(TextBox1.Text) * Cdbl(TextBox2.Text))

The CStr is just to be sure.

--

HTH

RP

"Minitman" wrote in message
.. .
Greetings,

I need to multiply the contents of TextBox1 with the contents of
TextBox2 and have the result show up in TextBox3. These three
TextBoxes are all on UserForm1.

I can't seem to get the syntax right. When I try to run any code It
kicks me into the debugger. Here is the code:

Private Sub TextBox1_Change()

SaveButton.Enabled = True
TextBox3.Value = (TextBox1.Value * TextBox2.Value) <<<<

End Sub

I also have it in TextBox2_Change()

The entry in TextBox1 is hours in decimal format and the entry in
TextBox2 is the rate in Dollars. All three TextBoxes have formatting
in an Exit event.

Any one see where I messed up?

TIA

-Minitman



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
how to multiply two values and round the result PirateJoe Excel Discussion (Misc queries) 6 April 23rd 23 11:48 AM
multiply two numbers and show the answer in a textbox gem Excel Discussion (Misc queries) 5 June 14th 06 12:07 AM
Multiply one cell by a factor and make that result round Machel_C Excel Worksheet Functions 7 March 15th 05 08:04 PM
Textbox updating other Textboxes Thomas L[_2_] Excel Programming 1 July 7th 04 08:33 PM
textbox result to label paradise Excel Programming 2 November 15th 03 01:10 PM


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

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

About Us

"It's about Microsoft Excel"