Pongo el código final para filtrar
Public campo1, campo2, campo3, campo4, campo5, campo6
Public h1
Private Sub ComboBox1_Change()
campo1 = ComboBox1
CommandButton3_Click
End Sub
Private Sub ComboBox2_Change()
campo2 = ComboBox2
CommandButton3_Click
End Sub
Private Sub ComboBox3_Change()
campo3 = ComboBox3
CommandButton3_Click
End Sub
Private Sub ComboBox4_Change()
campo4 = ComboBox4
CommandButton3_Click
End Sub
Private Sub DTPicker1_Change()
campo5 = DTPicker1
CommandButton3_Click
End Sub
Private Sub DTPicker2_Change()
campo6 = DTPicker2
CommandButton3_Click
End Sub
Private Sub CommandButton3_Click()
'Por.Dante Amor
'filtra los datos
Dim fecha1 As Date
Dim fecha2 As Date
Dim fecmax As Date
ListBox1 = ""
Set t = Sheets("temporal")
t.Cells.Clear
With h1
m = "X" 'columna de consecutivo
u = .Range("A" & Rows.Count).End(xlUp).Row
.Range(m & "5") = 5
.Range(m & "6") = 6
.Range(m & "7") = 7
If u > 7 Then h1.Range(m & "5:" & m & "7").AutoFill _
Destination:=h1.Range(m & "5:" & m & u), Type:=xlFillDefault
With .Range("A4:" & m & u)
If campo1 <> "" Then .AutoFilter Field:=1, Criteria1:=campo1
If campo2 <> "" Then .AutoFilter Field:=4, Criteria1:=campo2
If campo3 <> "" Then .AutoFilter Field:=6, Criteria1:=campo3
If DTPicker2 > fecmax Then fecha2 = Format(fecmax, "mm/dd/yyyy")
.AutoFilter Field:=2, Criteria1:=">=" & Format(DTPicker1.Value, "mm/dd/yyyy"), _
Operator:=xlAnd, Criteria2:="<=" & Format(DTPicker2.Value, "mm/dd/yyyy")
.SpecialCells(xlCellTypeVisible).Copy t.Range("A1")
Me.ListBox1 = ""
End With
.Range("A4").AutoFilter
cols = Array("A", 0, 0, 0, "E", "F", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "R", 0, 0, 0, 0, 0, 0)
For i = LBound(cols) To UBound(cols)
If cols(i) <> "0" Then n = Int(Hoja6.Range(cols(i) & 1).Width + 5) Else n = 0
ancho = ancho & n & ";"
Next
End With
u = t.Range("C" & Rows.Count).End(xlUp).Row
If u > 1 Then
With Me.ListBox1
.ColumnCount = Columns(m).Column
.ColumnHeads = True
.ColumnWidths = ancho
.RowSource = t.Name & "!A2:" & m & u
End With
End If
End Sub
Private Sub UserForm_Activate()
Set h1 = Sheets("Ord. Alquileres")
End Sub