Advertisement
5t0ff31

Excel vbs autofilter

Oct 21st, 2019
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '#################################################################################################
  2. '### Autofilter
  3. '#################################################################################################
  4. Private Sub Worksheet_Change(ByVal Target As Range)
  5.     Application.ScreenUpdating = False
  6.     If Not Intersect(Target, [B9:P9]) Is Nothing Then
  7.         If Not IsEmpty(Target.Value) Then
  8.             ActiveSheet.ListObjects("Tabelle13").Range.autofilter Field:=Target.Column - 1, Criteria1:="*" & Target.Value & "*"
  9.         Else
  10.             ActiveSheet.ListObjects("Tabelle13").Range.autofilter Field:=Target.Column - 1
  11.         End If
  12.     End If
  13. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement