generate report if cell is "EXPIRED"

hamistasty

Board Regular
Joined
May 17, 2011
Messages
208
Was hoping for some assistance or even a start-

On tab change:

I'd like code to check every column of a spreadsheet in range A & i to G & i, with i being until column A value is nothing.

So I'd like the code to check for the words "EXPIRED" and "RENEW" and then take the value of column A of that row, and put it into a new sheet.

For example:

On Sheet "employee" the code checks every cell in a range for the words "EXPIRED" and "RENEW" and finds that there are two found on different rows. It takes the first one found, copies the column A value of that row (the employees name) and puts it into the tab "report" and in the column next to that it puts the word "EXPIRED" because that was the word that was found. Then it copies the employee name of the second word found which was "RENEW", and pastes that into the new sheet underneath the last employee put in there, and again copies and pastes the word RENEW next to that column in the same row.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This is what AUTOFILTER is for. You can do this in seconds with it, and record it into a macro of your own if needed.

1) Click on row1 of the data table
2) Activate the Data > Filter > Autofilter
3) Use the new drop down in the correct column to apply a Custom filter for:

Contains: EXPIRED OR Contains: RENEW

4) Copy the column A and column ?? values to another sheet
5) Turn off the Autofilter.


Record those steps and see if you can use the resulting code again, tweak the filtering range to a range deep enough to copy all the possible results.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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