ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Create Macro to Tag Text (https://www.excelbanter.com/excel-worksheet-functions/101552-create-macro-tag-text.html)

GS4XX

Create Macro to Tag Text
 
Can someone help me with a macro?

I've got an excel worksheet with a huge number of rows. I want to identify
any row that contains certain text and tag that row with an "X" or something
that I can sort by in a new column. Does that make sense?

In other words, I'm in sales and have a huge list of customers with
products, I need to pull out any customer that has a specific product.

JLatham

Create Macro to Tag Text
 
Before getting into coding, you might look at a couple of things.

First, look at AutoFilter. Choose the top cell in the column of interest
and use Data | Filter |AutoFilter - then you will be able to choose from the
list to show just the rows with information you want to see in that column.

To put an X somewhere to show a match, assume that data is in column A for
this one, starting at row 2, assume column W is your first empty column. And
you want to identify rows with "bag of confetti" in column A.
In W2 put this
=IF(A2="bag of confetti","X","")
just extend the formula down the sheet. But that's only handy if you're
looking for one thing - have to change the "bag of confetti" each time you
want to look for something new. Better way:
in W2 put this
=IF(A2=$X$2,"X","")
extend down the rows.
Then i X2 write the phrase you're looking for in column A and Xs will show
up in W to indicate that. Change the phrase, change which show up with X.


"GS4XX" wrote:

Can someone help me with a macro?

I've got an excel worksheet with a huge number of rows. I want to identify
any row that contains certain text and tag that row with an "X" or something
that I can sort by in a new column. Does that make sense?

In other words, I'm in sales and have a huge list of customers with
products, I need to pull out any customer that has a specific product.



All times are GMT +1. The time now is 10:26 PM.

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