Mình có một đoạn code autofilter như sau
Sub locch()
With ActiveSheet
Application.ScreenUpdating = False
.Unprotect Password:="xyz"
If Len(.[C3]) >= 1 Then
.Cells.AutoFilter
.[$b$7:$b$538].AutoFilter Field:=1, Criteria1:=.[C3].Value & "*", Operator:=xlFilterValues
ActiveWindow.SmallScroll Down:=-30
Else
.[b$7:$b$538].AutoFilter Field:=1, Visibledropdown:=False
End If
.Protect Password:="xyz"
End With
Application.ScreenUpdating = True
End Sub
Nhờ các anh chị và các bạn trên diễn đàn sửa lại để code chạy nhanh hơn.
Chân thành cảm ơn!
Sub locch()
With ActiveSheet
Application.ScreenUpdating = False
.Unprotect Password:="xyz"
If Len(.[C3]) >= 1 Then
.Cells.AutoFilter
.[$b$7:$b$538].AutoFilter Field:=1, Criteria1:=.[C3].Value & "*", Operator:=xlFilterValues
ActiveWindow.SmallScroll Down:=-30
Else
.[b$7:$b$538].AutoFilter Field:=1, Visibledropdown:=False
End If
.Protect Password:="xyz"
End With
Application.ScreenUpdating = True
End Sub
Nhờ các anh chị và các bạn trên diễn đàn sửa lại để code chạy nhanh hơn.
Chân thành cảm ơn!