Help with macro please

slimimi

Well-known Member
Joined
May 27, 2008
Messages
532
Hi there.

I am trying to achieve the following:

User enters price into cell F5 (for example).
User clicks on button which fires macro which:
Looks at active cell
Asks user to enter "Enter Lot Size" into an input box perhaps.
Place a formula in the (next cell on the right) of the active cell (in this case Cell G5)

The Original Formula i had was :
=IF(F5>0,(F5-S5)*10000,"")

Now this formula (to go in Cell G5) will need to change to something like this (hope it makes sense) :
=IF(Active Cell>0,((Active Cell Value - S5)*1000)*(inputbox value x 10),"",cell G5)

I really have no idea how to put this altogether.
Would appreciate anyones kind help.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi
try the following codes
Code:
sub formula()
Dim a as long, dim b as long
a= inputbox("enter price")
b = Inputbox("enter lot size")
if a > 0 then
cells(5,8) = ((a - cells(5,17))*1000)*(bx 10)
else
cells(5,8) = cells(5,7)
endif
end sub
Run the macro.
Ravi
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top