Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GEM GEM is offline
external usenet poster
 
Posts: 90
Default multiplication

i have a userform for a carpet company which has a combo box with a list of
available carpets. once the user selects from the list the price of that
certain carpet per sqaure metre is shown in a text box below (each carpet has
a different price per square metre) that all works fine!!!

BUT.... the user has to type in the number of sqaure metres they need (which
is fine as they type it manually), but i then need a formula to multiply
these together to get a total cost (baring in mind the prices of the carpets
are all different and the number of sqaure metres they type in will be
different each time!!!)

e.g. i need the number of sqaure metres multiplied by the price per sqaure
metre!!!

hope i have explained myself properly!
thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default multiplication

Something like

Dim Tot as Double
Tot = Val(Textbox1.Text) * Val(Textbox2.Text)
Textbox3.Text = Format$(Tot, "# ##0.00")

HTH. Best wishes Harald

"gem" skrev i melding
...
i have a userform for a carpet company which has a combo box with a list

of
available carpets. once the user selects from the list the price of that
certain carpet per sqaure metre is shown in a text box below (each carpet

has
a different price per square metre) that all works fine!!!

BUT.... the user has to type in the number of sqaure metres they need

(which
is fine as they type it manually), but i then need a formula to multiply
these together to get a total cost (baring in mind the prices of the

carpets
are all different and the number of sqaure metres they type in will be
different each time!!!)

e.g. i need the number of sqaure metres multiplied by the price per sqaure
metre!!!

hope i have explained myself properly!
thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default multiplication

Using the change event for each text box, add code that multiplies the value
of the two text boxes and populates a lable with the resulting amount. The
code will look something like this (you will have to validate that both text
boxes contian numbers before running this code)...

Label1 = format(value(textbox1.text) * value(textbox2.text), "#,##0.00")
--
HTH...

Jim Thomlinson


"gem" wrote:

i have a userform for a carpet company which has a combo box with a list of
available carpets. once the user selects from the list the price of that
certain carpet per sqaure metre is shown in a text box below (each carpet has
a different price per square metre) that all works fine!!!

BUT.... the user has to type in the number of sqaure metres they need (which
is fine as they type it manually), but i then need a formula to multiply
these together to get a total cost (baring in mind the prices of the carpets
are all different and the number of sqaure metres they type in will be
different each time!!!)

e.g. i need the number of sqaure metres multiplied by the price per sqaure
metre!!!

hope i have explained myself properly!
thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default multiplication

Sorry... Where I have Value, use Val (similar to Harald's code...). I would
be more inclined to use a leble than a Text Box (as Harald uses) as text
boxes are designed for the user to enter text into where as lables are
designed to display text with no ability for the user to change the value...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Using the change event for each text box, add code that multiplies the value
of the two text boxes and populates a lable with the resulting amount. The
code will look something like this (you will have to validate that both text
boxes contian numbers before running this code)...

Label1 = format(value(textbox1.text) * value(textbox2.text), "#,##0.00")
--
HTH...

Jim Thomlinson


"gem" wrote:

i have a userform for a carpet company which has a combo box with a list of
available carpets. once the user selects from the list the price of that
certain carpet per sqaure metre is shown in a text box below (each carpet has
a different price per square metre) that all works fine!!!

BUT.... the user has to type in the number of sqaure metres they need (which
is fine as they type it manually), but i then need a formula to multiply
these together to get a total cost (baring in mind the prices of the carpets
are all different and the number of sqaure metres they type in will be
different each time!!!)

e.g. i need the number of sqaure metres multiplied by the price per sqaure
metre!!!

hope i have explained myself properly!
thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default multiplication

"Jim Thomlinson" skrev i melding
...
I would
be more inclined to use a leble than a Text Box (as Harald uses) as text
boxes are designed for the user to enter text into where as lables are
designed to display text with no ability for the user to change the

value...

Hi Jim

Sometimes users should be allowed to Ctrl-C the result, which would be a
reason to use a textbox. Otherwise labels make more sense, absolutely.

Best wishes Harald


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
Multiplication Danny Mac Excel Worksheet Functions 8 December 7th 06 10:28 PM
multiplication fitpeach3 Excel Worksheet Functions 2 September 19th 06 11:07 PM
Multiplication problem- Please Help! millzenator Excel Discussion (Misc queries) 8 May 17th 06 03:28 PM
Transpose multiplication Cap Kirk Excel Discussion (Misc queries) 3 October 21st 05 12:48 PM
Multiplication Table Faehnfare Setting up and Configuration of Excel 2 January 16th 05 05:40 PM


All times are GMT +1. The time now is 06:05 PM.

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"