Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Problem in using Advanced Filter

Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"), Unique:=False
Now the problem with the macro is that even when criteria is changing in
Range "A6:B8", it is always giving the same result that it gave when it was
run for the first time.

What is the reason for this error? Please help.
TIA
Shilps


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Problem in using Advanced Filter

Hi
do you mean even if you run the macro anew you still get the same
results?

--
Regards
Frank Kabel
Frankfurt, Germany


Shilps wrote:
Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"),
Unique:=False Now the problem with the macro is that even when
criteria is changing in Range "A6:B8", it is always giving the same
result that it gave when it was run for the first time.

What is the reason for this error? Please help.
TIA
Shilps


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem in using Advanced Filter

I would suspect that your criteria is either not specified properly or it at
leasts it does not produce what you expect.

for example

Name
Dog

as a criteria would also return records where the value in the Name column
was doghouse - you might expect only to get those with dog.

--
Regards,
Tom Ogilvy

"Shilps" wrote in message
...
Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"),

Unique:=False
Now the problem with the macro is that even when criteria is changing in
Range "A6:B8", it is always giving the same result that it gave when it

was
run for the first time.

What is the reason for this error? Please help.
TIA
Shilps




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Problem in using Advanced Filter



"Shilps" wrote:

Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"), Unique:=False
Now the problem with the macro is that even when criteria is changing in
Range "A6:B8", it is always giving the same result that it gave when it was
run for the first time.

What is the reason for this error? Please help.
TIA
Shilps


Try CopyToRange:=Range("A136:J136") don't know why but seeems to work for me

Tina

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Problem in using Advanced Filter

Go to CriteriaRange:=Sheets("Sheet3").Range("A6:B8"),

with F5 and look if this area is not changed by A6:B9 ???



"Shilps" a écrit dans le message de
...
Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"),

Unique:=False
Now the problem with the macro is that even when criteria is changing in
Range "A6:B8", it is always giving the same result that it gave when it

was
run for the first time.

What is the reason for this error? Please help.
TIA
Shilps






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Problem in using Advanced Filter

If your criteria range contains blank rows you'll get all the rows from
the table returned when you run the Advanced filter.

And you could qualify your range references, to ensure that the correct
ranges are being used. For example:

Dim wsA As Worksheet
Dim wsB As Worksheet
Set wsA = Sheets("Sheet1")
Set wsB = Sheets("Sheet3")
wsA.Range("A5:J42").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=wsB.Range("A6:B8"), _
CopyToRange:=wsA.Range("A136"), Unique:=False

Shilps wrote:
Hi,
I am trying to use Advanced Filter. I have this code

Range("A5:J500").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"Sheet3").Range("A6:B8"), CopyToRange:=Range("A136"), Unique:=False
Now the problem with the macro is that even when criteria is changing in
Range "A6:B8", it is always giving the same result that it gave when it was
run for the first time.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Advanced Filter Problem Mustang Excel Discussion (Misc queries) 3 May 9th 09 08:28 AM
Excel advanced filter problem CAM Excel Discussion (Misc queries) 0 February 22nd 08 01:16 AM
Problem with Advanced Filter Criteria nospaminlich Excel Discussion (Misc queries) 4 August 8th 07 12:28 AM
Advanced Filter problem R. Choate Excel Discussion (Misc queries) 14 May 28th 06 09:12 PM
Problem using Advanced filter anandmr65 Excel Discussion (Misc queries) 1 April 17th 06 10:14 AM


All times are GMT +1. The time now is 08:16 AM.

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

About Us

"It's about Microsoft Excel"