ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   First column that does not contain "Cucumber" (https://www.excelbanter.com/excel-worksheet-functions/5840-first-column-does-not-contain-%22cucumber%22.html)

umop apisdn

First column that does not contain "Cucumber"
 
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



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

--
Don Guillett
SalesAid Software

"umop apisdn" wrote in message
...
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





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))

--
Regards
Frank Kabel
Frankfurt, Germany


umop apisdn wrote:
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




All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com