Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Very simple Advanced Filter not working in macro

Columns("AB:AB").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Columns( _
"AC:AC"), Unique:=True

Simple Advanced Filter right?

Why will it not work within my macro?

i've even tried seperating it into its own macro and calling the rest of the
original macro but this still doesn't work.

Contained in column AB are codes containing letters and numbers, multiples
of these and also blank cells.

The strange thing is that if i do the AdvFilter manually first, then delete
the info and run the macro again it actually works! But this is a crazy way
of working and i need to do it regularly so any help much appreciated!

cheers



  #2   Report Post  
Posted to microsoft.public.excel.programming
Member
 
Location: In a hole in the ground there lived Joshua Fandango
Posts: 30
Default Very simple Advanced Filter not working in macro

Hi Adam,

A named range "Extract" is being created in column AC where the data
is filtered to; if you use the following after the advanced filter has
run this should solve the problem.

ActiveWorkbook.Names("Extract").Delete

HtH,
JF

On 17 Dec, 15:23, Adam wrote:
* * Columns("AB:AB").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Columns( _
* * * * "AC:AC"), Unique:=True

Simple Advanced Filter right?

Why will it not work within my macro? *

i've even tried seperating it into its own macro and calling the rest of the
original macro but this still doesn't work.

Contained in column AB are codes containing letters and numbers, multiples
of these and also blank cells. *

The strange thing is that if i do the AdvFilter manually first, then delete
the info and run the macro again it actually works! *But this is a crazy way
of working and i need to do it regularly so any help much appreciated!

cheers


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Very simple Advanced Filter not working in macro

Hi Joshua

I've copied it just as you've written but it's coming back with an
'Application-defined or object-defined error'?

i am missing something?

Cheers


"Joshua Fandango" wrote:

Hi Adam,

A named range "Extract" is being created in column AC where the data
is filtered to; if you use the following after the advanced filter has
run this should solve the problem.

ActiveWorkbook.Names("Extract").Delete

HtH,
JF

On 17 Dec, 15:23, Adam wrote:
Columns("AB:AB").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Columns( _
"AC:AC"), Unique:=True

Simple Advanced Filter right?

Why will it not work within my macro?

i've even tried seperating it into its own macro and calling the rest of the
original macro but this still doesn't work.

Contained in column AB are codes containing letters and numbers, multiples
of these and also blank cells.

The strange thing is that if i do the AdvFilter manually first, then delete
the info and run the macro again it actually works! But this is a crazy way
of working and i need to do it regularly so any help much appreciated!

cheers



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Very simple Advanced Filter not working in macro

Adam,

Cell AC1 must be blank or have the same heading as the list in AB

HTH,
Bernie
MS Excel MVP


"Adam" wrote in message
...
Columns("AB:AB").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Columns( _
"AC:AC"), Unique:=True

Simple Advanced Filter right?

Why will it not work within my macro?

i've even tried seperating it into its own macro and calling the rest of the
original macro but this still doesn't work.

Contained in column AB are codes containing letters and numbers, multiples
of these and also blank cells.

The strange thing is that if i do the AdvFilter manually first, then delete
the info and run the macro again it actually works! But this is a crazy way
of working and i need to do it regularly so any help much appreciated!

cheers





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Very simple Advanced Filter not working in macro

Hi Bernie

Yes they have the same heading in both AB1 and AC1

Adam


"Bernie Deitrick" wrote:

Adam,

Cell AC1 must be blank or have the same heading as the list in AB

HTH,
Bernie
MS Excel MVP


"Adam" wrote in message
...
Columns("AB:AB").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Columns( _
"AC:AC"), Unique:=True

Simple Advanced Filter right?

Why will it not work within my macro?

i've even tried seperating it into its own macro and calling the rest of the
original macro but this still doesn't work.

Contained in column AB are codes containing letters and numbers, multiples
of these and also blank cells.

The strange thing is that if i do the AdvFilter manually first, then delete
the info and run the macro again it actually works! But this is a crazy way
of working and i need to do it regularly so any help much appreciated!

cheers






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 not working correctly in macro Tara H Excel Programming 9 January 28th 09 08:06 PM
working in the Advanced Filter in 2003 Excel Hydz Excel Discussion (Misc queries) 1 January 9th 09 03:47 AM
Advanced Filter Critera using formula not working KKPeters Excel Worksheet Functions 5 April 17th 08 10:45 PM
Advanced Filter not working babypenquin Excel Worksheet Functions 1 June 22nd 06 05:48 PM
Advanced Filter Not Working Cthulhu Excel Discussion (Misc queries) 2 May 10th 05 07:24 PM


All times are GMT +1. The time now is 06:36 PM.

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"