spiffmonkey1
New Member
- Joined
- Jun 23, 2011
- Messages
- 41
Hi,
Part of my formula is this-
Dim r As Long
For r = 4 To 10
'1 box colored G=G
If WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "yes") = 1 _
And WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "N/A") = 8 _
And WorksheetFunction.CountBlank(Range(Cells(69, r), Cells(80, r))) = 3 Then
Range(Cells(67, r), Cells(67, r + 1)).Interior.ColorIndex = 50
'1 box colored R=R
If WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "no") = 1 _
And WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "N/A") = 8 _
And WorksheetFunction.CountBlank(Range(Cells(69, r), Cells(80, r))) = 3 Then
Range(Cells(67, r), Cells(67, r + 1)).Interior.ColorIndex = 3
I want to know if there is a way to use Else or a similar statement where only if none of these If's work, then show "N/A". Because if I put the Else statement inside the IF's, then it'll show N/A if one of the IF statement is false.
Thanks
Part of my formula is this-
Dim r As Long
For r = 4 To 10
'1 box colored G=G
If WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "yes") = 1 _
And WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "N/A") = 8 _
And WorksheetFunction.CountBlank(Range(Cells(69, r), Cells(80, r))) = 3 Then
Range(Cells(67, r), Cells(67, r + 1)).Interior.ColorIndex = 50
'1 box colored R=R
If WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "no") = 1 _
And WorksheetFunction.CountIf(Range(Cells(69, r), Cells(80, r)), "N/A") = 8 _
And WorksheetFunction.CountBlank(Range(Cells(69, r), Cells(80, r))) = 3 Then
Range(Cells(67, r), Cells(67, r + 1)).Interior.ColorIndex = 3
I want to know if there is a way to use Else or a similar statement where only if none of these If's work, then show "N/A". Because if I put the Else statement inside the IF's, then it'll show N/A if one of the IF statement is false.
Thanks