Is this word in column B

mackay

New Member
Joined
Oct 10, 2006
Messages
2
User has imported 5 columns, and an unknown number of rows.

Want a macro activated by, say, CTL-K which will see if the word 'warning' is in colmn B of any row.

If found at least once, need a message or something to say so. Otherwise a message to say 'not found'.

That is all I need at the moment..
But I might also like to look for 2 or 3 words, and show appropriate messages if they were found.

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hello,

How about

Code:
Sub FIND_WORD()
    MY_WORD = InputBox("ENTER WORD", "DATA ENTRY")
    For MY_ROWS = 1 To Range("B65536").End(xlUp).Row
        If Range("B" & MY_ROWS).Value Like "*" & MY_WORD & "*" Then
            MY_ENTRY = MsgBox(MY_WORD & " found in B" & MY_ROWS, vbOKOnly, "FOUND")
            Exit Sub
        End If
    Next MY_ROWS
            MY_ENTRY = MsgBox(MY_WORD & " NOT found in B", vbOKOnly, "FOUND")
End Sub
 
Upvote 0
Find This word

Hope this reply gets associated with my question and the answer.

Thank you so much for such a quick reply. It does just what I need.

Thank you, thank you.

Regards
Robert
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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