Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need help Urgently because I have tried everything and cannot make my
macro work. What I need is a Macro that will check Let say cell a1:a15 for the letter P or F and if one cell is blank to skip and check until 3 cells are covered. a1 = p a2 = p a3 = a4 = f a5 = p a6 = p I am in cell a20, I need to check cell a1:a15, if a1,a2,a3 is 2 "p" I need "compliant" or if a1,a2,a3 <2 "p" I need "not compliant" the problem I am having is if a1,a2 has a p or f and a3 does not etc, to skip the blank and use the last three filled cells --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You want to find if 3 adjacent cells contain "p" or "f"?
Sub Checkcompliance() Dim bCompliant As Boolean Dim i As Long bCompliant = False For i = 1 To 13 If Application.Sum(Application.CountIf(Cells(i, 1).Resize(3, 1), Array("p", "f"))) = 3 Then bCompliant = True Exit For End If Next If bCompliant Then MsgBox "Compliant" Else MsgBox "Not Compliant" End If End Sub Regards, Tom Ogilvy "bossbubba " wrote in message ... I need help Urgently because I have tried everything and cannot make my macro work. What I need is a Macro that will check Let say cell a1:a15 for the letter P or F and if one cell is blank to skip and check until 3 cells are covered. a1 = p a2 = p a3 = a4 = f a5 = p a6 = p I am in cell a20, I need to check cell a1:a15, if a1,a2,a3 is 2 "p" I need "compliant" or if a1,a2,a3 <2 "p" I need "not compliant" the problem I am having is if a1,a2 has a p or f and a3 does not etc, to skip the blank and use the last three filled cells --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
skipping blank cells in dynamic chart | Charts and Charting in Excel | |||
Concatenation and skipping blank cells | Excel Worksheet Functions | |||
Skipping Blank Cells | Excel Discussion (Misc queries) | |||
formula to populate while skipping blank fields | Excel Worksheet Functions | |||
Skipping Blank Or Null Cells In a Lookup Function | Excel Worksheet Functions |