Help With Very Simple Code

  • Thread starter Thread starter pauluk
  • Start date Start date
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)
 
This is really starting to annoy me, I just dont know why and what
wrong with i
 
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
 
Put in a msgbox to see what CLng(CDate(strDate)) is returning
 
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
 
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
 
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
 

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

Back
Top