Filter Problem

G

Guest

My filter is not returning any data. Here is the applicable portion of the
code:

Sub WorkOrdersCompletedByDate()
Prompt = "Please Enter Beginning Date (mm/dd/yy). Hitting 'Cancel' Will
End the Macro."
Title = "Print Completed Work Orders for a Specific Date Range"
newname1 = InputBox(Prompt, Title, "mm/dd/yy")
Prompt = "Please Enter Ending Date (mm/dd/yy). Hitting 'Cancel' Will
End the Macro."
Title = "Print Completed Work Orders for a Specific Date Range"
newname2 = InputBox(Prompt, Title, "mm/dd/yy")
Selection.AutoFilter Field:=12, Criteria1:=">=Newname1", Operator:=xlAnd _
, Criteria2:="<=newname2"
End Sub

Is there a # format issue here???? Someone please help!!!! THANK YOU!!!
 
A

aidan.heritage

Your quotation marks are wrong - your criteria returns the literal
=NewName1 rather than the compound you want

try

criteria1:=">=" & newname1

NOTE you may still need to format newname1 (though hopefully not!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top