AdvancedFilter VBA
  Home FAQ Contact Sign in
microsoft.public.excel only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.excel Profile…
 Up
AdvancedFilter VBA         


Author: Sandy
Date: Feb 10, 2008 06:10

I have a named range (dynamic) called 'HomeRecordsAll' which refers to a
range currently ("A1:GL28") on Sheets("HomeCourse").

The name refers to :-
'=OFFSET(HomeCourse!$A$9,0,0,COUNT(RecordOfRounds!$A$52:$A$10000)+1,194)'.

I am attempting to incorporate the 'HomeRecordsAll' into code for an
advanced filter.
The following does not work:-

Sheets("HomeCourse").Select
Range("HomeRecordsAll").AdvancedFilter Action:=xlFilterInPlace, _
Criteria:=Range("A1:E2"), Unique:=False

Any help appreciated.
Thanks
Sandy
10 Comments
Re: AdvancedFilter VBA         


Author: Sandy
Date: Feb 10, 2008 06:38

Oops - the range in the first line should read ("A9:GL28")
Sandy
Show full article (0.76Kb)
no comments
Re: AdvancedFilter VBA         


Date: Feb 10, 2008 11:02

Hi Sandy

Try
Sheets("HomeCourse").Select
Range("HomeRecordsAll").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("A1:E2"), Unique:=False

--
Regards
Roger Govier
Show full article (0.90Kb)
no comments
Re: AdvancedFilter VBA         


Author: Ron Coderre
Date: Feb 10, 2008 13:06

From any sheet in the workbook....perhaps this:

With Sheets("HomeCourse")
Range("HomeRecordsAll").AdvancedFilter _
Action:=xlFilterInPlace, _
Criteriarange:=.Range("A1:E2"), _
Unique:=False
End With

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
Show full article (1.05Kb)
no comments
Re: AdvancedFilter VBA         


Author: DJH
Date: Feb 10, 2008 17:36

Sandy:
That should work, but make sure each column in your "HomeRecordsAll" range
has a column Heading
and within your criteria range (A1:E2) each cell in row 1 has one of your
194 column headings.

"Sandy" DELETEhotmail.com> wrote in message
news:5AF39E4C-D321-4CE8-B133-82054EF46829@microsoft.com...
> Oops - the range in the first line should read ("A9:GL28")
> Sandy
>
> "Sandy" ...
Show full article (1.11Kb)
no comments
Re: AdvancedFilter VBA         


Author: Don Guillett
Date: Feb 11, 2008 06:14

I notice that you goto a lot of trouble to safeguard your email address and
yet attach unwelcome workbooks to a message to a newsgroup who does not want
them. If someone wants to see your workbook they will offer for you to send
directly to them.
http://www.cpearson.com/excel/newposte.htm

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"Sandy" DELETEhotmail.com> wrote in message
news:BE7518D4-AD74-418C-AAB3-4EDDFF45CCE5@microsoft.com...
>...
Show full article (1.75Kb)
no comments
Re: AdvancedFilter VBA         


Author: Sandy
Date: Feb 11, 2008 06:35

Don

My apologies - I did not realise it was taboo.
I consider myself reprimanded.

Sandy

"Don Guillett" austin.rr.com> wrote in message
news:#0t7khLbIHA.4172@TK2MSFTNGP02.phx.gbl...
> I notice that you goto a lot of trouble to safeguard your email address
> and yet attach unwelcome...
Show full article (2.03Kb)
no comments
Re: AdvancedFilter VBA         


Date: Feb 11, 2008 06:55

Hi Sandy

Whilst I agree with what Don said, and you have acknowledged the fact, I
have on this occasion opened your workbook.
Your problem is that you have no headers to your data on Records of Rounds.
Advanced Filter cannot work without headers.

--
Regards
Roger Govier

"Sandy" DELETEhotmail.com> wrote in message
news:BE7518D4-AD74-418C-AAB3-4EDDFF45CCE5@microsoft.com...
> Hi Guys,
>
> I have tried all of your suggestions - no avail.
>
> Still getting...
Show full article (1.65Kb)
no comments
Re: AdvancedFilter VBA         


Author: Sandy
Date: Feb 11, 2008 07:35

Roger, and all

I tried headers on the RecordOfRounds sheet again to no avail - however I
wondered if the fact that the Sub was on RecordOfRounds and the
AdvancedFilter was on HomeCourse, if this had a bearing so without any
further adjustment to my workbook other than move my code to a module, it
now operates perfectly.

Not sure why, but......

Thanks again
Sandy

"Roger Govier" wrote in message
news:1F54A704-D68C-4491-98E0-D3D82A18F987@microsoft.com...
> Hi Sandy
>
> Whilst I agree with what Don said, and you have acknowledged...
Show full article (2.23Kb)
no comments
Re: AdvancedFilter VBA         


Date: Feb 11, 2008 09:24

Hi Sandy

No the code wouldn't work form a Sheet, it does need to be in an inserted
module.
I hadn't bothered to look for any code in your workbook, when I saw that
there were no modules. I thought you had just sent the sheet with any
macros, so people would have less fear of opening them.
I could see you didn't have a header row for your data - hence my response.

Your code (different to the question you posted) only works without headers
because you are first copying all of the data from the Source
(RecordsofRounds) to the Destination (Homecourse).
With only 19 rows of data that isn't too much of an overhead, but with a
large data set it would be different.
That is not necessary - you can filter the records directly.
Show full article (4.46Kb)
no comments
1 2