Value

mks

Board Regular
Joined
Aug 28, 2009
Messages
173
Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
I have the following formula, I want to amend this formula to add the value of “one” in Cell D83 on same sheet ( which has existing “If function” to add values) if sInp1 value is greater or equal to 1.20 and Same if sInp2 is value is greater or equal to 1.20.
I mean If sInp 1 & sInp2 value are greater than or equal to 1.20 than add one for each value in Cell D83.
Formula –
<o:p> </o:p>
Private Sub CommandButton2_Click()
<o:p> </o:p>
Dim sInp1 As Double
Dim sInp2 As Double
Dim sInp3 As Double
Dim Cell As Range
<o:p> </o:p>
Dim sOut As Range
<o:p> </o:p>
On Error Resume Next
sInp1 = Application.InputBox("Enter Length of Linen")
If Not IsNumeric(sInp1) Then Exit Sub
sInp2 = Application.InputBox("Enter Second Length Of Linen")
If Not IsNumeric(sInp2) Then Exit Sub
sInp3 = Application.InputBox("Enter Numbers of Shelf")
If Not IsNumeric(sInp3) Then Exit Sub
<o:p> </o:p>
Set sOut = Application.InputBox("Select Output Cell", Type:=8)
If sOut Is Nothing Then Exit Sub
sOut.Value = ((sInp1 + sInp2) - 0.45) * sInp3
End Sub
thanks
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Give this a try. Add it before End Sub...

Code:
If slnp1 >= 1.2 Or slnp2 >= 1.2 Then
    Range("D83").Value = "one"
End If
 
Last edited:
Upvote 0
Hi Sean,

Thansk for reply, does this add the value "1" in Cell D 83 which has the existing if function. I mean if Cell D83 have value "5" than it should become 6 or 7. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,608
Messages
6,179,872
Members
452,949
Latest member
Dupuhini

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