Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro skipping blank cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro skipping blank cell

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
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
skipping blank cells in dynamic chart Ravens Fan Charts and Charting in Excel 4 January 9th 08 05:24 PM
Concatenation and skipping blank cells soma104 Excel Worksheet Functions 6 May 31st 06 01:12 PM
Skipping Blank Cells Coltsfan Excel Discussion (Misc queries) 1 October 13th 05 01:23 AM
formula to populate while skipping blank fields Chris Hudd Excel Worksheet Functions 1 July 12th 05 10:41 AM
Skipping Blank Or Null Cells In a Lookup Function Bill Johnson Excel Worksheet Functions 8 December 24th 04 01:06 AM


All times are GMT +1. The time now is 02:14 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"