First column that does not contain "Cucumber"

U

umop apisdn

Hi,

I have 100 columns. How do I find the first column that does not contain
any cell with the value "Cucumber".

Thanks for any help,

Rob
 
D

Don Guillett

one way

Sub findnot()
For Each c In Range("c6:g6")
If ucase(c) <> "CUCUMBER" Then MsgBox c.Column: Exit Sub
Next
End Sub
 
F

Frank Kabel

Hi
for a formula approach try something like the following array formula
(entered with CTRL+SHIFT+ENTER):
=MIN(IF(A1:X100="Cucumber",COLUMN(A1:X100))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top