LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter a range in a different instance of excel

Yes, they are equivalent.

You can use whatever gives you the proper object.



--
Regards,
Tom Ogilvy

"Alan" wrote in message
...
"Tom Ogilvy" wrote in message
...

Dim r1 as Range
newBook.Worksheets("Sheet1").Activate
set r1 = newBook.Worksheets("Sheet1").Range("A2")
set r1 = r1.Parent.Range(r1, r1.End(xlToRight))
set r1 = r1.parent.Range(r1, r1.End(xlDown))
r1.AutoFilter


selection will refer to the selection in the instance of Excel with
the code. You will need to fully qualify references to objects in
the other instance.


Hi Tom (or anyone else who cares to join the discussion),

This is for my (and others') understanding of the use of the 'parent'
property.

In your above answer, what is the (conceptual?) difference between the
following two statements?

set r1 = r1.Parent.Range(r1, r1.End(xlToRight))

set r1 = newBook.Worksheets("Sheet1").Range(r1, r1.End(xlToRight))


I understood that the parent object (pObj) of a given object (gObj) is
the object that 'contains' our gObj.

If I then understand the excel object model (big assumption!) the
following expressions are equivalent in the example above:

r1.parent
newBook.Worksheets("Sheet1")

since newBook.Worksheets("Sheet1") is the object that 'contains'
newBook.Worksheets("Sheet1").range("A2")


Am I missing something here? Or is it perhaps just a matter of taste?

Thanks in advance,

Alan.








 
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
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
What is Range For Chart AutoFilter Range VBA? [email protected] Excel Discussion (Misc queries) 0 April 19th 06 05:30 PM
Find 2nd instance of a word in a range. Grumpy Grandpa Excel Worksheet Functions 8 December 5th 05 03:29 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"