Help With Very Simple Code

P

pauluk

Hi All,

Is this me just being simple or what?

I cant seem to get this piece of code to work. I have on hidden row bu
it is below the autofilter range. I am alos using a form create
through Data > Form

Dim rng As Range
Dim strDate As String

Sheets("Telephone Stats").Select

strDate = Application.InputBox("Please enter date you require dat
for", "Manager Checks")

Selection.AutoFilter Field:=7, _
Criteria1:="=" & CLng(CDate(strDate)
 
P

pauluk

No this is fine.

Criteria:="=" & CLng(CDate(strDate))

the "=" indicates that it has tob equal to what is placed in the inpu
box. i.e. less than or equals is <=

Even if i take this out or change from short integer to long on data i
shown. If i do this manually the data shows.

So help pleas
 
P

pauluk

When i check the data it is returning the correct information.

I.e. when i put 07/04/2004 that is the search it is doing just that n
info appears. This data does exisit on the sheet because it is my tes
data.

I have tried this on two machines and two versions of excel excel200
(which will use it) and excel 200
 
G

Greg Koppel

Try performing the steps manually with the macro recorder on and see if
Excel is using the format you expect. If you like, send me the workbook to
look at.

Regards, Greg
 
P

pauluk

Bob The out put is 38084 if i remove CLng the format is 7/4/2004

The format i require is dd/mm/yyyy

I tried this at home last night but using excel 2002 and it worke
fine. In work i use excel 2000.

looking at the format i may need to custome i
 
Top