JonasB
01-27-2021, 04:37 PM
27820
Hello :)
According to the example above it should show records starting with ( like% ) the letters "tip" in the the specified "date range".
Please tell me what's wrong in the code below:
=====
Option Explicit
Sub data_controle()
Dim lngStart As Long, lngEnd As Long
Dim Repres As String
lngStart = Range("b4").Value
lngEnd = Range("c4").Value
Range("c12:m2000").AutoFilter Field:=1, _
Criteria1:=">=" & lngStart, _
Operator:=xlAnd, _
Criteria2:="<=" & lngEnd
Range("C13", Range("C13").End(xlDown)).Sort Key1:=Range("C13"), Order1:=xlAscending, Header:=xlNo
ActiveSheet.Range("$C$12:$M$2109").AutoFilter Field:=1, Criteria1:=">=" & lngStart, Operator:=xlAnd, Criteria2:="<=" & lngEnd
' the line below is not working ... ? - Repres
' ActiveSheet.Range("d4").AutoFilter Field:=2, Criteria1:=Repres & "*"
End Sub
=====
Thank you :friends:
Hello :)
According to the example above it should show records starting with ( like% ) the letters "tip" in the the specified "date range".
Please tell me what's wrong in the code below:
=====
Option Explicit
Sub data_controle()
Dim lngStart As Long, lngEnd As Long
Dim Repres As String
lngStart = Range("b4").Value
lngEnd = Range("c4").Value
Range("c12:m2000").AutoFilter Field:=1, _
Criteria1:=">=" & lngStart, _
Operator:=xlAnd, _
Criteria2:="<=" & lngEnd
Range("C13", Range("C13").End(xlDown)).Sort Key1:=Range("C13"), Order1:=xlAscending, Header:=xlNo
ActiveSheet.Range("$C$12:$M$2109").AutoFilter Field:=1, Criteria1:=">=" & lngStart, Operator:=xlAnd, Criteria2:="<=" & lngEnd
' the line below is not working ... ? - Repres
' ActiveSheet.Range("d4").AutoFilter Field:=2, Criteria1:=Repres & "*"
End Sub
=====
Thank you :friends: