ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adv filter fails in macro, works fine manually (https://www.excelbanter.com/excel-programming/436020-adv-filter-fails-macro-works-fine-manually.html)

headly

Adv filter fails in macro, works fine manually
 
Excel 2007 is giving me such a headache;

Recorded macro code
Columns("B2:B2819").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("AB65000"), Unique:=True

Should extract 6 values

When run from inside a procedure it fails to extract anything;
When run manually without a macro running it works fine;
Additional info: Column A is already filtered to 1 value, now I need to get
the associated values from column B; At this point i have already ran extract
unique on column A with no problem

muddan madhu

Adv filter fails in macro, works fine manually
 
Range("B2:B2819").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"AB65000"), unique:=True



On Nov 11, 12:24*am, headly wrote:
Excel 2007 is giving me such a headache;

Recorded macro code
Columns("B2:B2819").AdvancedFilter Action:=xlFilterCopy, _
* * * *CopyToRange:=Range("AB65000"), Unique:=True

Should extract 6 values

When run from inside a procedure it fails to extract anything;
When run manually without a macro running it works fine;
Additional info: Column A is already filtered to 1 value, now I need to get
the associated values from column B; At this point i have already ran extract
unique on column A with no problem



Barb Reinhardt

Adv filter fails in macro, works fine manually
 
I don't do advanced filtering, but I don't see any criteria.
--
HTH,

Barb Reinhardt



"headly" wrote:

Excel 2007 is giving me such a headache;

Recorded macro code
Columns("B2:B2819").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("AB65000"), Unique:=True

Should extract 6 values

When run from inside a procedure it fails to extract anything;
When run manually without a macro running it works fine;
Additional info: Column A is already filtered to 1 value, now I need to get
the associated values from column B; At this point i have already ran extract
unique on column A with no problem


OssieMac

Adv filter fails in macro, works fine manually
 
Problem is Columns("B2:B2819")

Should be or Columns("B:B")
or
Range("B1:B2819")

Note that the header must be included when using advanced filter or the
first value becomes the column header in the filtered range.

--
Regards,

OssieMac


"headly" wrote:

Excel 2007 is giving me such a headache;

Recorded macro code
Columns("B2:B2819").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("AB65000"), Unique:=True

Should extract 6 values

When run from inside a procedure it fails to extract anything;
When run manually without a macro running it works fine;
Additional info: Column A is already filtered to 1 value, now I need to get
the associated values from column B; At this point i have already ran extract
unique on column A with no problem


OssieMac

Adv filter fails in macro, works fine manually
 
My apologies if this post twice. I got an error when trying to post the first
time.

The problem is Columns("B2:B2819")

Should be or Columns("B:B")
or
Range("B1:B2819")

Note that the header must be included when using advanced filter or the
first value becomes the column header in the filtered range.

--
Regards,

OssieMac


"headly" wrote:

Excel 2007 is giving me such a headache;

Recorded macro code
Columns("B2:B2819").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("AB65000"), Unique:=True

Should extract 6 values

When run from inside a procedure it fails to extract anything;
When run manually without a macro running it works fine;
Additional info: Column A is already filtered to 1 value, now I need to get
the associated values from column B; At this point i have already ran extract
unique on column A with no problem



All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com