Private Sub CommandButton1_Click()
If Val(Application.Version) >= 12 Then
[G2] = ">=" & Format(TextBox1, "mm/dd/yyyy")
[H2] = "<=" & Format(TextBox2, "mm/dd/yyyy")
Else
[G2] = ">=" & TextBox1
[H2] = "<=" & TextBox2
End If
[A1:E1000].AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=[G1:H2], CopyToRange:=[G6:K6]
End Sub