iif statements

  • Thread starter Thread starter cvegas
  • Start date Start date
C

cvegas

I am familuar with iif statements in Access but I am new to excel.

I have a cell in this workbook that references another page in the same
workbook

I want to determine if the value in that cell is >=51

If it is I need to insert 126.50 into a cell and if it isn't then I need to
insert 113.00 into that cell.

I have no idea how to accomplish this. I have looked at help but do not
find anything under the iif category.

Any help would be appreciated.
 
You posted in programming so may we assume you want a macro.

if sheets("yoursheet").range("yourrnage")>=51 then
range("yourdestinationcell")=126.50
else
range("yourdestinationcell")=113
end if
 
Sub iffy()
Set r1 = Range("A1")
Set r2 = Range("A2")
If r1.Value >= 51 Then
r2.Value = 126.5
Else
r2.Value = 113
End If
End Sub

Naturally if you want to examine and change the same cell, just make r1 and
r2 the same.
 
Back
Top