Re: List Values Meeting Date Criteria
milyenabox,
I modified zimitry code to what I believe you wanted.
Sub Opensorter()
Dim xlShtBalance As Worksheet
Dim xlShtx As Worksheet
Dim xlLngRow1 As Long
Dim xlLngRow2 As Long
Dim xlLngRow3 As Long
Dim xlInt As Integer
Dim xlDate As Date
Set xlShtBalance = Sheets("balance")
Set xlShtx = Sheets("x")
xlLngRow1 = xlShtBalance.Cells(Rows.Count, 1).End(xlUp).Row
xlLngRow2 = xlShtBalance.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
For xlInt = 1 To xlLngRow1 Step 1
If IsDate(xlShtBalance.Cells(xlInt, 1)) Then
xlDate = DateValue(CDate(xlShtBalance.Cells(xlInt, 1)))
xlLngRow3 = xlShtx.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To xlLngRow3 Step 1
If IsDate(xlShtx.Cells(i, 1)) Then
If xlDate <= CDate(xlShtx.Cells(i, 6)) And CDate(xlShtx.Cells(i, 1)) <= xlDate And CDate(xlShtx.Cells(i, 6)) <> xlDate Then
xlShtx.Range("A" & i, "F" & i).Copy Destination:=xlShtBalance.Cells(xlLngRow2, 4)
xlShtBalance.Cells(xlLngRow2, 3).Value = Format(xlDate, "MMM-DD-YYYY")
End If
End If
xlLngRow2 = xlShtBalance.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
Next i
End If
xlLngRow2 = xlShtBalance.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
Next xlInt
Set xlShtBalance = Nothing: Set xlShtx = Nothing
End Sub
Display More