Two IF Statements Q

S

Sean

I have the following code (partial extract), which I am attempting to
add 2 IF statements, but the 2nd is not returning the required action

O169 = 0
BD1 = 98

Thus I expect the Importance to be set to High, if O169 or BD1 > 0,
otherwise set to normal

How would I incorporate that into code below? (Currently it is setting
importance to Normal)

Thanks

With OutMail
.To = ThisWorkbook.Sheets("Value").Range("AJ1").Value
.CC = strto
.BCC = ""
.Subject =
ThisWorkbook.Sheets("Values").Range("AJ4").Value
.Body = strbody
.Attachments.Add Destwb.FullName
.ReadReceiptRequested = False
If Sheets("Values").Range("O169").Value > 0 Then
.Importance = 2
If Sheets("Values").Range("BD1").Value > 0 Then
.Importance = 2
Else
.Importance = 1
End If
End If
 
S

Stefi

..Importance = IIf(Sheets("Values").Range("O169").Value > 2 Or
Sheets("Values").Range("BD1").Value > 0, 2, 1)

Regards,
Stefi

„Sean†ezt írta:
 

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

Similar Threads


Top