Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula for detecting a certain pattern in a particular row or column?

Hi,

I wonder if there's a formula for detecting a certain pattern in a
particular row or column?

Any of the cells within the range of "start", and "end" would trigger
"do XXX"


Presudo code would be:

If I can see "X" in range(start, end) Then
do XXX
Else
do OOO
End If


Thanks,
Jacky

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Formula for detecting a certain pattern in a particular row or col

Dim rStart as Range, rEnd as Range
Set rStart = Range("A1")
Set rEnd = rStart.Specialcells(xlLast)
If Application.countif(range(rstart, rend),"X") 0 Then
XXX
Else
OOO
End If

if X is a substring

If Application.countif(range(rstart, rend),"*X*") 0 Then

Assumes XXX and OOO are the names of macros in the same module

--
Regards,
Tom Ogilvy

" wrote:

Hi,

I wonder if there's a formula for detecting a certain pattern in a
particular row or column?

Any of the cells within the range of "start", and "end" would trigger
"do XXX"


Presudo code would be:

If I can see "X" in range(start, end) Then
do XXX
Else
do OOO
End If


Thanks,
Jacky


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula for detecting a certain pattern in a particular row or col

On Feb 8, 12:41 am, Tom Ogilvy
wrote:
Dim rStart as Range, rEnd as Range
Set rStart = Range("A1")
Set rEnd = rStart.Specialcells(xlLast)
If Application.countif(range(rstart, rend),"X") 0 Then
XXX
Else
OOO
End If



Hi Tom,

Thanks for the code. I am using Excel 2000, where do I type all these
code in? Currently, I am using short codes in the cells like "=
+COUNTIF(E18:IV101, "O")"

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
Subtl column A based on column B. Each time B changes pattern? Me Excel Discussion (Misc queries) 1 December 3rd 08 03:50 PM
Search /Filter vertical Numeric pattern (down single column) Sam via OfficeKB.com Excel Programming 0 July 7th 06 11:32 PM
Search /Filter vertical Numeric pattern (down single column) Sam via OfficeKB.com Excel Worksheet Functions 0 July 7th 06 06:25 PM
Detecting changes in results of formula spacecityguy[_9_] Excel Programming 3 January 27th 06 09:03 PM
detecting row or column insertion & deletion arun Excel Programming 5 July 28th 04 07:26 PM


All times are GMT +1. The time now is 02:52 AM.

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"