A UDF can do this. For example:
Option Explicit
Function CollateYears(fYear As Range, lYear As Range) As String
Dim lfYear As Long: lfYear = fYear.Value
Dim llYear As Long: llYear = lYear.Value
CollateYears = lfYear
If lfYear = llYear Then Exit Function
Do Until lfYear > llYear
CollateYears = CollateYears & "," & lfYear
lfYear = lfYear + 1
Loop
End Function
Copy and paste the code into a standard module and then use it as a normal function.
=CollateYears(A1,B1) gives 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 if A1 has 2001 and B1 has 2010.
Regards
Bookmarks