Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Prompt user for input

How do I write a macro to prompt a user for a margin percent number and then
take that number and multiple the actual product cost by that percent markup?
Is there a built-in function for this process already in Excel 2000?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Prompt user for input

Hi Jerry -

Youve used margin and markup in the same question. Note that these values
are defined (and calculated) differently so two procedures are included below.

Margin: The percentage margin is the percentage of the final selling price
that is profit.
Markup: A markup is the percentage of the cost price to add on to get the
selling price.

Both procedures assume that your ProductCost is in cell A2. Both calculate
the final price (cost + margin or markup):

Sub Margin()
'Margin Version: Final Price = Cost/(1-Margin/100)
mPercent = InputBox("Please enter Margin Percent (whole number):")
Range("B2") = Range("A2") / (1 - (mPercent / 100))
End Sub

Sub Markup()
'Markup Version: FinalPrice = Cost * (1+Markup/100)
mPercent = InputBox("Please enter Markup Percent (whole number):")
Range("B2") = Range("A2") * (1 + (mPercent / 100))
End Sub

--
Jay


"Jerry Foley" wrote:

How do I write a macro to prompt a user for a margin percent number and then
take that number and multiple the actual product cost by that percent markup?
Is there a built-in function for this process already in Excel 2000?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Prompt user for input

Here is a similar method

Sub ProdMarg()
marginPct = Application.InputBox("Enter the Margin Percentage as a whole
number. No Decimal point.", "Margin", Type:=1)
marginPct = marginPct/100
ProdCost = Application.InputBox("Enter Product Cost as whole number",
"Product Cost", Type:=1)
ProdCost = (ProdCost * marginPct) + ProdCost
MsgBox "$" & ProdCost
End Sub

"Jerry Foley" wrote:

How do I write a macro to prompt a user for a margin percent number and then
take that number and multiple the actual product cost by that percent markup?
Is there a built-in function for this process already in Excel 2000?
Thanks

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
Prompt user to input data (pop-up box) Shags Excel Discussion (Misc queries) 2 January 13th 09 06:05 AM
Can Excell prompt for user input... Will Excel Discussion (Misc queries) 0 April 12th 07 10:36 PM
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
variables in footers; how to prompt user for input within macro dangles Excel Programming 1 January 20th 06 11:17 PM
Prompt For User Mouse Input In Macro? oBis Excel Programming 0 May 6th 04 02:50 PM


All times are GMT +1. The time now is 09:42 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"