Find two values and select data in between

G

gaba

I need to separate good and bad data to work with. The data is in Range A:F
to last row.

I set flags ("good" and "bad") in column G to last row. (This part works)

I need to find the first "good" flag,
if the next flag is "good", select the cells in between cut and paste (A:F)
in "G14" or next empy row after "G14"
If the next flag is "bad", select the cells in between (A:F) and set to
Interior Color index = 40.

second flag becomes first, find next flag and so on

It may seem a simple question but since I'm learning it is not for me.
Thanks in advance
 
N

Nate Oliver

Hello,

I might try using an Autofilter on Column G. Select G, Data -> Filter ->
Autofilter. Filter on 'Bad'. Select A:F and fill the cells, only the visible
cells will fill.

As far as the good cells, filter on 'Good'. Copy and paste to where you
want, then delete the rows (or clear them) on the original, visible cells.

Then remove the filter by selecting to Autofilter again.

All of this can be automated by using your macro recorder and cleaning up
the code a touch (e.g., remove selections, etc...)

Regards,
Nate Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top