LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Combining Fors and Ifs

Is it possible to combine the following :-

For Each MyCell In Sheets("Current Round Detailed").Range("C10:K10")
If (MyCell.Value 0 And MyCell.Offset(12).Value = vbNullString) Or
_
(MyCell.Value 1 And MyCell.Offset(14).Value = vbNullString)
Then

MsgBox "xxxxxxxxx"

Exit Sub
End If
Next MyCell

For Each MyCell In Sheets("Current Round Detailed").Range("C16:K16")
If (MyCell.Value 0 And MyCell.Offset(17).Value = vbNullString) Or
_
(MyCell.Value 1 And MyCell.Offset(19).Value = vbNullString)
Then

MsgBox "yyyyyyyyyyy"

Exit Sub
End If
Next MyCell

into something along the lines of :-

If
For Each MyCell In Sheets("Current Round Detailed").Range("C10:K10")
If (MyCell.Value 0 And MyCell.Offset(12).Value = vbNullString) Or
_
(MyCell.Value 1 And MyCell.Offset(14).Value = vbNullString)
End If
Next MyCell

Or

For Each MyCell In Sheets("Current Round Detailed").Range("C16:K16")
If (MyCell.Value 0 And MyCell.Offset(17).Value = vbNullString) Or
_
(MyCell.Value 1 And MyCell.Offset(19).Value = vbNullString)
End If
Next MyCell
Then "zzzzzzzzzzzzzzzz"

Thanks in advance
Sandy

 
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
Combining AND, MID, and OR bquirk Excel Worksheet Functions 2 January 21st 08 08:07 PM
Combining one row into two nabanco Excel Worksheet Functions 2 July 12th 07 11:15 PM
Combining look up and last? Sarah Excel Discussion (Misc queries) 4 January 9th 07 10:01 AM
Combining Sum, IF and AND Kenton_SJ Excel Discussion (Misc queries) 1 August 3rd 05 11:30 PM
combining IF and AND Dahlman Excel Discussion (Misc queries) 5 May 12th 05 08:21 PM


All times are GMT +1. The time now is 09:00 AM.

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

About Us

"It's about Microsoft Excel"