mercredi 17 mars 2021

IF condition for date autofilter

I need to apply "IF" condition for date autofilter. But nothing happened. I guess that my autofilter dosn't understend my creteria

please look at my part of code!

Private Sub CommandButton5_Click() 
Dim SS21StartDate As Date
Dim SS21EndDate As Date
SS21StartDate = 1 / 1 / 2021
SS21EndDate = 6 / 31 / 2021
If Me.ComboBox1.Value = ("SS21") Then
         ws.Range("$A$1:$N$3251").AutoFilter Field:=11, Criteria1:=">=" & CDbl(SS21StartDate), Operator:=xlAnd, Criteria2:="<=" & CDbl(SS21EndDate)

         End If

Aucun commentaire:

Enregistrer un commentaire