I want to compare dates to find the ones that overlap.

The first function I created checks for full overlap, partial overlap, or no overlap.

This is the 2nd function. It will be used to expand upon the partial overlap process, comparing what does in fact overlap, and provide either a sequence of dates that are between the overlapped range, or to create the first date with a dash and last date that overlap. 

Code I have so far:

```
Public Function partialdates(SD1 As Integer, ED1 As Integer, SD2 As Integer, ED2 As Integer) As String

'This function will be expanded, but the first If statement takes 1 case such that the first set of dates overlaps, but not beginning with the start date: SD1 = 1885 ED1 = 1969, SD2 = 1897 ED2 = 1972

    Dim i As Integer 
    Dim years As Integer
    Dim difference As Integer

    If SD1 < SD2 And SD1 <= ED2 And ED1 <= ED2 And ED1 >= SD2 Then
        difference = ED1 - SD2
        For i = 1 To difference

' I need help with this, to create a sequence of years that will be what are 
' overlapped, such as 1897, 1898, 1899...etc

            years = years & ", " + 1           
        Next
        partialdates = years
    End If
End Function

```