Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Two IF Statements Q

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Two IF Statements Q

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

Regards,
Stefi

€žSean€ť ezt Ă*rta:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Two IF Statements Q

Thanks Stefi, works like a dream

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Two IF Statements Q

You are welcome! Thanks for the feedback!
Stefi

€žSean€ť ezt Ă*rta:

Thanks Stefi, works like a dream


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If and then statements. KAD Excel Worksheet Functions 4 June 24th 08 09:55 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
If statements fuzzylogic Excel Worksheet Functions 9 September 19th 06 02:07 AM
operator statements, shorting when reusing one of the statements? KR Excel Programming 1 August 4th 05 06:20 PM
If Then Statements Wally Steadman[_4_] Excel Programming 3 December 31st 04 08:00 PM


All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"