Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sub BCCT_Update()
Application.ScreenUpdating = False
'Xoa noi dung cu cua bao cao
'Lenh cap nhat du lieu tu dong
'Tao bo loc tu dong
'Loc theo cac dieu kien cua bao cao
ActiveSheet.Range("$A$2:$F$47").AutoFilter Field:=2, Criteria1:=Sheet1.Cells(4, 9).Value
ActiveSheet.Range("$A$2:$F$47").AutoFilter Field:=1, _
Criteria1:=">=" & CLng(Sheet1.Cells(2, 9).Value), _
Operator:=xlAnd, _
Criteria2:="<=" & CLng(Sheet1.Cells(3, 9).Value)
'Copy noi dung ket qua bao cao
'Luu noi dung vao bao cao chi tiet
Range("H6").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'Bo che do Copy
Application.CutCopyMode = False
'Bo bo loc tu dong
Application.ScreenUpdating = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment