Find any cell in Row=

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,954
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Is there an nice Excel way to see if any cell in a row contains the string "See Comment" ?
Or should I just loop through all of them ?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Assuming content is in row 1 (from A1 to J1)

as the last column, pls put formula K1=concat(A1:J1)

then, in the next column L1=IFERROR(IF(FIND("see comment",K1)>0,"Yes","No"),"No")

all rows with yes in L1 will have "see comment" in them


alternatively, you may also use conditional formatting to highlight those cells which have "see comment" in them
 
Upvote 0
Using the same range as Arun try:
Excel Formula:
=IF(COUNTIFS($A1:$J1,"*see comment*")>0,"Yes","""No")
 
Upvote 0
The columns involved are 9 to 18, now not the entire row, I ended up using
VBA Code:
For i = 9 To 18 ' I to R
            If .Cells(ExcelRow, i) = "See Comment" Then
                 .Cells(ExcelRow, i).Font.Color = 16711935
            End If
Next
Which seems to work ok. I wasn't able to get the suggestions to compile.
Maybe goes in a worksheet cell? Sorry, should have said this was in a module.
I'd use it if I could! (I've never used a worksheet formula)
 
Upvote 0
Your method highlights each cell in the row that = "See Comment", which is different to flagging if it appears anywhere in a row.
The other methods are both aimed at being used in the worksheet although you could put them in a worksheetfunction.
They also use "contains" rather than "=" so will still count it if there is more text surrounding the "See Comment"
The countifs version is not case sensitive both your method and using the find function are case sensitive.
 
Upvote 0
I'll run some casing tests and use case insensitive if needed. And change to Instr. You're right - maybe a random space could have got in.
 
Upvote 0

Forum statistics

Threads
1,221,669
Messages
6,161,195
Members
451,687
Latest member
KENNETH ROGERS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top