I would like to extract all row meeting the criteria in column G and z then copy to another sheet. Criteria in Column G is "Female" and Criteria in Z is >18. To be particular, I am looking to get all the females who are above 18 then copy the result to a new sheet. Here the the two macro to that I need to combine Thanks in advance
Sub CopyFemale()
Dim c As range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
Set Source = ActiveWorkbook.Worksheets("Sheet1")
Set Target = ActiveWorkbook.Worksheets("Sheet2")
j = 1
For Each c In Source.range("G1:G1000")
If c = "Female" Then
Source.Rows(c.Row).Copy Target.Rows(j)
j = j + 1
End If
Next c
End Sub
Sub CopyGreater()
Dim c As range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
Set Source = ActiveWorkbook.Worksheets("Sheet1")
Set Target = ActiveWorkbook.Worksheets("Sheet2")
j = 1
For Each c In Source.range("Z1:Z1000")
If c >= 0 Then
Source.Rows(c.Row).Copy Target.Rows(j)
j = j + 1
End If
Next c
End Sub