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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
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
 

mackay

New Member
Joined
Oct 10, 2006
Messages
2
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
 

Forum statistics

Threads
1,141,681
Messages
5,707,796
Members
421,529
Latest member
Balintn

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
Top