iif statements

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

Don Guillett

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
 
G

Gary''s Student

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top