![]() |
Help With Very Simple Code
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) -- Message posted from http://www.ExcelForum.com |
Help With Very Simple Code
This is really starting to annoy me, I just dont know why and what
wrong with i -- Message posted from http://www.ExcelForum.com |
Help With Very Simple Code
Well, you've got Criteria1:="="
HTH, Greg "pauluk " wrote in message ... 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 but it is below the autofilter range. I am alos using a form created through Data Form Dim rng As Range Dim strDate As String Sheets("Telephone Stats").Select strDate = Application.InputBox("Please enter date you require data for", "Manager Checks") Selection.AutoFilter Field:=7, _ Criteria1:="=" & CLng(CDate(strDate)) --- Message posted from http://www.ExcelForum.com/ |
Help With Very Simple Code
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 -- Message posted from http://www.ExcelForum.com |
Help With Very Simple Code
Put in a msgbox to see what CLng(CDate(strDate)) is returning
"pauluk " wrote in message ... No this is fine. Criteria:="=" & CLng(CDate(strDate)) the "=" indicates that it has tob equal to what is placed in the input box. i.e. less than or equals is <= Even if i take this out or change from short integer to long on data is shown. If i do this manually the data shows. So help please --- Message posted from http://www.ExcelForum.com/ |
Help With Very Simple Code
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 -- Message posted from http://www.ExcelForum.com |
Help With Very Simple Code
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 "pauluk " wrote in message ... 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 no info appears. This data does exisit on the sheet because it is my test data. I have tried this on two machines and two versions of excel excel2000 (which will use it) and excel 2002 --- Message posted from http://www.ExcelForum.com/ |
Help With Very Simple Code
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 -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 06:49 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com