ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find two values and select data in between (https://www.excelbanter.com/excel-programming/318967-find-two-values-select-data-between.html)

gaba

Find two values and select data in between
 
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

--
gaba :)

Nate Oliver[_3_]

Find two values and select data in between
 
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

gaba

Find two values and select data in between
 
Thanks so much, Nate. I'll give it a try
Gaba

"Nate Oliver" wrote:

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



All times are GMT +1. The time now is 12:07 PM.

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