I am trying to figure out how to have a macro run on the active row
and if certain conditions are met then do another function.
Example:
if the active row contains AAA BBB CCC in ANY order of the three
cells, then I need it to move on and do another function.
I hope this makes sense.
Any help is appreciated.
Thanks
Christina
Don Guillett - 01 Nov 2007 00:22 GMT
One way
Sub ifabc()
Dim i As Long
myarray = Array("aaa", "bbb", "ccc")
For i = 10 To 1 Step -1
If Not IsError(Application.Match(Cells(1, i).Value, myarray, 0)) _
Then mc = mc + 1
Next i
If mc >= 3 Then MsgBox "doit"
End Sub

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>I am trying to figure out how to have a macro run on the active row
> and if certain conditions are met then do another function.
[quoted text clipped - 9 lines]
> Thanks
> Christina
Chip Pearson - 04 Nov 2007 17:57 GMT
I don't see where Conditional Formatting fits in, but you could do something
like
If Abs(Not (IsError(Application.Match("aaa", ActiveCell.EntireRow, 0)))) + _
Abs(Not (IsError(Application.Match("bbb", ActiveCell.EntireRow, 0)))) +
_
Abs(Not (IsError(Application.Match("ccc", ActiveCell.EntireRow, 0)))) =
3 Then
Debug.Print "Do your thing"
Else
Debug.Print "Do nothing"
End If

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
>I am trying to figure out how to have a macro run on the active row
> and if certain conditions are met then do another function.
[quoted text clipped - 9 lines]
> Thanks
> Christina