Hello,
First time poster here hoping if you could answer me a problem I have with an excel spreadsheet,
I have a database with a lot of information (7 to 10k rows) so I can't do this thing manually.
One fo the columns in the database is "year" and it, ideally, should go from 2004 to 2008 (2004, 2005, 2006, 2007, 2008). But I have missing years so, sometimes, it goes: 2004, 2005, 2006 and then jumps back again to 2004 or it jumps straight from 2008 to 2006 and so on.
Now I would like to know if there's a macro that I could use that would, pretty much read row by row the year value and check:
-If the value is 2004, keep it.
-if the next value is 2005, keep it.
-if the next value is 2006, etc.
but, if the sequence breaks at any point, erase those rows completely and start counting again.
I'd be thankful for anyone to help me with this, thanks.
First time poster here hoping if you could answer me a problem I have with an excel spreadsheet,
I have a database with a lot of information (7 to 10k rows) so I can't do this thing manually.
One fo the columns in the database is "year" and it, ideally, should go from 2004 to 2008 (2004, 2005, 2006, 2007, 2008). But I have missing years so, sometimes, it goes: 2004, 2005, 2006 and then jumps back again to 2004 or it jumps straight from 2008 to 2006 and so on.
Now I would like to know if there's a macro that I could use that would, pretty much read row by row the year value and check:
-If the value is 2004, keep it.
-if the next value is 2005, keep it.
-if the next value is 2006, etc.
but, if the sequence breaks at any point, erase those rows completely and start counting again.
I'd be thankful for anyone to help me with this, thanks.