Find Specific Word (s) Macro

Russ At Index

Well-known Member
Joined
Sep 23, 2002
Messages
704
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi All,

Have 35k + row ss which has in col E the description of the
product.

Is it at all possible to have a macro identify specific words within
the description column (eg the word "Xmas") & place an "x" in column L to as to
identify the row ???

TIA

Russ
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Untested but may give you an idea:

Code:
Dim c As Range, firstaddress As String

With Columns(5) 'search column E(5)
    Set c = .Find("Xmas", LookIn:=xlValues, lookat:=xlPart)
    If Not c Is Nothing Then
        firstaddress = c.Address
        Do
            Cells(c.Row, "L") = "X" 'put X in column L of found row
            Set c = .FindNext(c)
        Loop While Not c Is Nothing And c.Address <> firstaddress
    End If
End With
 
Upvote 0

Russ At Index

Well-known Member
Joined
Sep 23, 2002
Messages
704
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi Kirsty ,

Thanks for the prompt response , i will give your code a try
first thing in the morning .... just one qestion , after posting
i noticed i would want to identify several "words" , to report
in col L.


Would i amend your code:
Find("Xmas",

to

Find("Xmas","Other","Another", "etc","etc",

TIA

Russ
 
Upvote 0

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
No, that would not work. A couple of things that could be done:

- an inputbox for the user to specify multiple words to search for, separated by commas

OR

- List the words to be searched down a column on the page.

Do you have a preference?
 
Upvote 0

Forum statistics

Threads
1,195,628
Messages
6,010,770
Members
441,568
Latest member
abbyabby

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