Hey All. My first post. Could really use some help. Urgent too. So I am making a database within excel with a search engine. Lists of values determine the search engine's criteria in respective cells. Everything worked great, until I added dates. The criteria I used for between dates is this:

Dim Teeth As Variant
Teeth = ">=" & Sheets("Home Page").Range("H12").Value
Dim Teeth1 As Variant
Teeth1 = "<=" & Sheets("Home Page").Range("I12").Value

'this is the filter for the date search. The critera allows for search in-betwen the two dates
Sheets("QA Repository").Select

Selection.AutoFilter Field:=6, Criteria1:=Teeth, Operator:=xlAnd _
, Criteria2:=Teeth1, Operator:=xlAnd_

It works with all of my other search engine criteria, but the issue is that the earliest date would need to go in a specific cell, and the latest date would have to go in a specific cell, because the between criteria reads as ">=" and "<=", so it wouldnt work if latest date and earliest date were in the wrong cells... So this is what I did to solve that issue... Which works..

Sheets("Home Page").Select
If Sheets("Home Page").Range("H12").Value > Sheets("Home Page").Range("I12").Value Then
Sheets("Home Page").Range("H12").Select
Selection.Cut
Range("H13").Select
ActiveSheet.Paste
Sheets("Home Page").Range("I12").Select
Selection.Cut
Range("I13").Select
ActiveSheet.Paste
Sheets("Home Page").Range("H13").Select
Selection.Cut
Range("I12").Select
ActiveSheet.Paste
Sheets("Home Page").Range("I13").Select
Selection.Cut
Range("H12").Select
ActiveSheet.Paste

It basically swaps the two values if they are in the wrong positions. It works, but now I need excel to understand that if there are no dates in the boxes, to treat it as all values, not as searching for blanks, which it does not do. I used all of the typical stuff...

If LookupVal = blank Then
LookupVal = False
If LookupVal = False Then
LookupVal = "<>"
End If
End If

but none of it seems to work... Anyone have any suggestions?