Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autofilter vba dont show filtered data

When i run my autofilter code, range with autofilter is empty ( except autofilter columns ). Then if i select "(Custom...)" in autofilter list i can see correct dates in criteria fields and after i cick OK, Autofilter filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" , Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter vba dont show filtered data

Try

Range("a1").AutoFilter Field:=4, Criteria1:="=" & DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except

autofilter columns ). Then if i select "(Custom...)" in autofilter list i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,

Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autofilter vba dont show filtered data

Thanks Tom, but it didnt work :(


"Tom Ogilvy" wrote:

Try

Range("a1").AutoFilter Field:=4, Criteria1:="=" & DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except

autofilter columns ). Then if i select "(Custom...)" in autofilter list i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,

Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter vba dont show filtered data

Did you correct my typo. I had 2005 in the first critera - change it to
2004 (nothing would match the criteria I set).


Other than that, try turning on the macro recorder and recording while you
do it manually, but I have good success with what I suggested.

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
Thanks Tom, but it didnt work :(


"Tom Ogilvy" wrote:

Try

Range("a1").AutoFilter Field:=4, Criteria1:="=" &

DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except

autofilter columns ). Then if i select "(Custom...)" in autofilter list

i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,

Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autofilter vba dont show filtered data

Yep. i fixed typo. There must be something wrong with the Cell Format and date column, because if i try to autofilter other column that contains numbers only, code works.


"Tom Ogilvy" wrote:

Did you correct my typo. I had 2005 in the first critera - change it to
2004 (nothing would match the criteria I set).


Other than that, try turning on the macro recorder and recording while you
do it manually, but I have good success with what I suggested.

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
Thanks Tom, but it didnt work :(


"Tom Ogilvy" wrote:

Try

Range("a1").AutoFilter Field:=4, Criteria1:="=" &

DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except
autofilter columns ). Then if i select "(Custom...)" in autofilter list

i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,
Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter vba dont show filtered data

There is by definition. The autofilter has problems with dates when set
from VBA if the date format of the region (of that verion) uses non US
english convention (mm/dd/yyyy). Using serial numbers usually helps.
Numbers are not a problem usually.

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
Yep. i fixed typo. There must be something wrong with the Cell Format and

date column, because if i try to autofilter other column that contains
numbers only, code works.


"Tom Ogilvy" wrote:

Did you correct my typo. I had 2005 in the first critera - change it

to
2004 (nothing would match the criteria I set).


Other than that, try turning on the macro recorder and recording while

you
do it manually, but I have good success with what I suggested.

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
Thanks Tom, but it didnt work :(


"Tom Ogilvy" wrote:

Try

Range("a1").AutoFilter Field:=4, Criteria1:="=" &

DateSerial(2005,5,27), _
Operator:=xlAnd, Criteria2:="<=" & DateSerial(2004,6,3)

--
Regards,
Tom Ogilvy

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty (

except
autofilter columns ). Then if i select "(Custom...)" in autofilter

list
i
can see correct dates in criteria fields and after i cick OK,

Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,
Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Autofilter vba dont show filtered data

PPesola,
Try,
Range("A1").AutoFilter Field:=4, Criteria1:="=" &
cdbl(DateSerial(2004,5,27)), _
Operator:=xlAnd, Criteria2:="<=" & cdbl(DateSerial(2004,6,3))
Cecil

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except

autofilter columns ). Then if i select "(Custom...)" in autofilter list i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,

Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autofilter vba dont show filtered data

Thanks Cecil, it works!!!

"Cecilkumara Fernando" wrote:

PPesola,
Try,
Range("A1").AutoFilter Field:=4, Criteria1:="=" &
cdbl(DateSerial(2004,5,27)), _
Operator:=xlAnd, Criteria2:="<=" & cdbl(DateSerial(2004,6,3))
Cecil

"PPesola" wrote in message
...
When i run my autofilter code, range with autofilter is empty ( except

autofilter columns ). Then if i select "(Custom...)" in autofilter list i
can see correct dates in criteria fields and after i cick OK, Autofilter
filter and show correct rows.

my autofilter code;

Range("a1").AutoFilter Field:=4, Criteria1:="=27.5.2004" ,

Operator:=xlAnd, Criteria2:="<=3.6.2004"

I'm using Excel 97 and Windows XP Pro




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Charts dont refresh to show changes to data sheet Chrisso Charts and Charting in Excel 0 August 26th 09 05:27 PM
graph, data lables value, dont show zero values Madeleine Charts and Charting in Excel 1 February 14th 08 05:55 PM
Autofilter and count on filtered data gr8posts Excel Worksheet Functions 7 October 19th 07 09:17 PM
How can I make autofilter show the filtered number of rows bsell123 Excel Worksheet Functions 1 October 28th 04 06:12 PM
Autofilter with vba wont dispay filtered data PPesola Excel Programming 1 June 16th 04 12:30 PM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"