PC Review


Reply
Thread Tools Rate Thread

Adv filter fails in macro, works fine manually

 
 
headly
Guest
Posts: n/a
 
      10th Nov 2009
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
 
Reply With Quote
 
 
 
 
muddan madhu
Guest
Posts: n/a
 
      10th Nov 2009
Range("B2:B2819").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"AB65000"), unique:=True



On Nov 11, 12:24*am, headly <hea...@discussions.microsoft.com> 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


 
Reply With Quote
 
Barb Reinhardt
Guest
Posts: n/a
 
      11th Nov 2009
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

 
Reply With Quote
 
OssieMac
Guest
Posts: n/a
 
      11th Nov 2009
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

 
Reply With Quote
 
OssieMac
Guest
Posts: n/a
 
      11th Nov 2009
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adv Filter fails in macro, works manually --elizabeth Microsoft Excel Programming 32 10th Apr 2010 09:39 PM
Net use with hostname fails, IP address works fine Luc Kumps Windows Vista Networking 2 4th Mar 2008 02:44 PM
Invalid Argument with Query wizard, works fine manually!!! =?Utf-8?B?Q2FzZXkgUA==?= Microsoft Access Queries 0 6th Sep 2006 01:58 PM
Macro works fine on PC; fails on Mac marlea Microsoft Excel Programming 1 20th Mar 2006 08:26 PM
Redemption program works fine in NT 4.0, fails in XP Mitchell Nussbaum Microsoft Outlook VBA Programming 3 5th Dec 2003 06:32 AM


Features
 

Advertising
 

Newsgroups
 


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