The below vba code attempts to extract a smaller list from a larger list based on Maturity Dates. However, it doesn't seem to work when I copied this code into a new spreadsheet.
The red portion is the one first highlighted by Microsoft visual basic to be erroneous. There could very well be more errors.
Please help.
Thank you.
Sub maturityRange()
Dim i, j, k As Integer
With Sheet12
Do While .[Maturity].Offset(i + 1, 0).Value <> ""
If .[Maturity].Offset(i + 1, 0).Value <= .[EndDate].Value And .[Maturity].Offset(i + 1, 0).Value >= .[StartDate].Value Then
For k = 0 To 2
.[List].Offset(j + 1, k) = .[Description].Offset(j + 1, k).Value
Next k
j = j + 1
End If
i = i + 1
Loop
End With
End Sub
Bookmarks