jeudi 2 avril 2015

How do I get a list of year ranges, from a list of years?

I have an excel spreadsheet that has a column containing a list of years that the car parts fit. As an example, there is a single cell containing the following data:



2006, 2005, 2004, 2003, 2002, 2001, 1999, 1998, 1995, 1993, 1992, 1991, 1990, 1989, 1988, 1987


I want to combine the years into a list of ranges, like the following:



2006-2001, 1999-1998, 1995, 1993-1987


Does anyone have a VBA code that will do this, or know how to accomplish this? Any help would be HIGHLY appreciated!! Thanks so much!


Aucun commentaire:

Enregistrer un commentaire