em xem trên diễn đàn thấy code lọc dữ liệu theo ngày của anh quanghai1969 thấy rất hay như sau:
http://www.giaiphapexcel.com/forum/...ch-thêm-về-code-lọc-dữ-liệu-của-bác-RoberLiem
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$2" Then
[IV2].FormulaR1C1 = "=Data!RC2=R2C5"
Rows("5:10000").Clear
Sheet1.[A1:H10000].AdvancedFilter 2, [IV1:IV2], [B4].CurrentRegion
If [B5] <> "" Then Range([B5], [B65536].End(3)) = [row(a:a)]
End If
End Sub
em muốn đặt code lọc ở 4 sheet khác nhau trong file thì code phải sửa như thế nào ạ?
nếu như trong sheet data em chend xuống mấy dòng thì kết quả lọc không chính xác, cách khắc phục như thế nào ạ?
em xin cảm ơn cả nhà!
http://www.giaiphapexcel.com/forum/...ch-thêm-về-code-lọc-dữ-liệu-của-bác-RoberLiem
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$2" Then
[IV2].FormulaR1C1 = "=Data!RC2=R2C5"
Rows("5:10000").Clear
Sheet1.[A1:H10000].AdvancedFilter 2, [IV1:IV2], [B4].CurrentRegion
If [B5] <> "" Then Range([B5], [B65536].End(3)) = [row(a:a)]
End If
End Sub
em muốn đặt code lọc ở 4 sheet khác nhau trong file thì code phải sửa như thế nào ạ?
nếu như trong sheet data em chend xuống mấy dòng thì kết quả lọc không chính xác, cách khắc phục như thế nào ạ?
em xin cảm ơn cả nhà!