Em muốn trích xuất những người "chủ hộ"sang sheeet 2 mà không chạy được. Em xin chân thành cảm ơn!
Sub GPE2()
Sheet2.Range("A7:I20000").Clear
Dim DCuoi As Long
DCuoi = Sheet1.Range("A20000").End(xlUp).Row
Sheet1.Range("A4:I" & DCuoi).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheet2.Range("D12"), CopyToRange:=Sheet2.Range("A7"), Unique:=False
DCuoi = Sheet2.Range("A20000").End(xlUp).Row
Sheet2.Range("A8:A" & DCuoi).Formula = "=ROWS($1:1)"
End Sub
Sub GPE2()
Sheet2.Range("A7:I20000").Clear
Dim DCuoi As Long
DCuoi = Sheet1.Range("A20000").End(xlUp).Row
Sheet1.Range("A4:I" & DCuoi).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheet2.Range("D12"), CopyToRange:=Sheet2.Range("A7"), Unique:=False
DCuoi = Sheet2.Range("A20000").End(xlUp).Row
Sheet2.Range("A8:A" & DCuoi).Formula = "=ROWS($1:1)"
End Sub