Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using Advanced Filter w/o having to set focus on the sheet

It seems that the advanced filter will only work if the sheet has focus. I
have to do something like this.

With oSourceBook.Sheets(QPR_AGENT_SHEET_NAME)
.Range("A1") = "Agent"
.Range("A2") = "ag1"
.Range("A3") = "ag2"
.Range("A4") = "ag3"
.Range("A5") = "ag4"
.Range("A6") = "ag5"
.Range("A7") = "ag6"

' Filter the data
oSourceBook.Activate
.Select
Set oRangeToFilter = .Range("A8:" &
..UsedRange.Cells.SpecialCells(xlCellTypeLastCell) .Address)
oRangeToFilter.AdvancedFilter xlFilterInPlace, Range("A1:A7"), True
End With

I would like to remove the activate and select methods, is it possible?

tia



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 - Copying to location other than current sheet? Maki Excel Discussion (Misc queries) 6 January 13th 10 08:10 AM
Advanced filter to another sheet goayimm Excel Discussion (Misc queries) 1 June 5th 08 03:30 AM
Help wanted for Advanced filter/sheet protection Kathrine Excel Worksheet Functions 0 March 28th 07 12:59 AM
Advanced Filter w/ multiple sheet List Range stickandrock Excel Worksheet Functions 0 April 18th 06 02:18 PM
Advanced Filter to another sheet Rishi Dhupar Excel Programming 1 February 8th 06 07:29 PM


All times are GMT +1. The time now is 09:48 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"