#### slimimi

##### Well-known Member
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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

#### ravishankar

##### Well-known Member
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

Replies
5
Views
436
Replies
3
Views
307
Replies
4
Views
548
Replies
0
Views
748
Replies
0
Views
188

1,191,166
Messages
5,985,051
Members
439,935
Latest member
Monty238

### 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.

### Which adblocker are you using?

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

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