Dear Friends,
I have found below from net suitable for my requirement and managed to do some changes, sample file attached here with.
In the sheet test I can select date and click on show data which will bring all data falling between out date and in date, i have another filter 'Name', when i select the Name, it should bring only that name which is in column O, i am stcuck here, cant go ahead, appreciated if any one can help.
Regards
Hanim
I have found below from net suitable for my requirement and managed to do some changes, sample file attached here with.
In the sheet test I can select date and click on show data which will bring all data falling between out date and in date, i have another filter 'Name', when i select the Name, it should bring only that name which is in column O, i am stcuck here, cant go ahead, appreciated if any one can help.
Code:
Sub testextract()
Sheets("test").Select
Range("B21:O20000").Select
Selection.ClearContents
Sheets("test").Select
Dim r As Range, r1 As Range, Sh As Worksheet, sh1 As Worksheet
Dim cell As Range, rDate As Range, v As Variant
Dim dt As Date, dt1 As Date, i As Long, rw As Long
Dim cell1 As Range, bHidden As Boolean
v = Array("ismail", "vijendra", "aashik", "sabeena", "gyzel", "khodr", "simmi")
Set Sh = Worksheets("test")
Set rDate = Sh.Range("F2")
' dt will hold the date of the last day of the month for the date in D6
'dt = DateSerial(Year(rDate), Month(rDate) + 1, 0)
dt = Sh.Range("AS17")
dt1 = Sh.Range("AT17")
For i = LBound(v) To UBound(v)
Set sh1 = Worksheets(v(i))
Set r = sh1.Range("C3:C1000")
For Each cell In r
bHidden = False
Set cell1 = cell.Offset(0, 12).Resize(1, 1) ' H:AD
If cell >= dt Then
If cell <= dt1 Then
'If Application.CountIf(cell1, "<>""") > 0 Then
rw = Sh.Cells(Sh.Rows.Count, "C").End(xlUp).Row + 1
If cell.EntireRow.Hidden = True Then bHidden = True
'cell.EntireRow.Hidden = False
cell.EntireRow.Copy
If rw < 21 Then rw = 21
Sh.Cells(rw, 1).PasteSpecial xlValues
'Sh.Cells(rw, 1).PasteSpecial xlFormats
End If
End If
If bHidden = True Then cell.EntireRow.Hidden = True
Next cell
Next i
End Sub
Hanim