Is there a requirement to select a workbook or worksheet to ensure that the filter (if there is one) is null?
Is there a requirement to select a workbook or worksheet to ensure that the filter (if there is one) is null?

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Who would impose that requirement? Gordon Brown?
No, it is a habit that I have acquired, but was wondering if the selection was needed?
No, you can use code like this:
Workbooks("OtherWorkbook.xls").Worksheets("SomeShe et").ShowAllData
There is no need to activate Otherworkbook.xls or SomeSheet.
But:
(I always get cunfused with this "selection" business)
To sort a range, like so:
where w1a is the worksheet, that has to be active, right??Code:Set y1a = w1a.Range("A2:R" & x1a) y1a.Sort Key1:=Range("K2"), Order1:=xlAscending, Key2:=Range("L2"), Order2:=xlAscending, Header:=xlNo
No "actual selection" is made, but if the sheet is not active, I get:
[attachment=86670:Sort.GIF]
![]()
No, w1a doesn't have to be the active sheet. The problem here is that the sort keys Range("K1") and Range("L2") do refer to the active sheet because you don't tell VBA that they are on w1a. But of course you can't sort w1a on keys on another sheet! You must specify explicitly that the sort keys are on w1a:
Set y1a = w1a.Range("A2:R" & x1a)
y1a.Sort Key1:=w1a.Range("K2"), Order1:=xlAscending, Key2:=w1a.Range("L2"), Order2:=xlAscending, Header:=xlNo
Arh, got'ya! Thankyou very much!!
Another little'un if I may:
Set v2 = Workbooks.Open(Filename:="C:\Users\Nathan\Document s\mybook.xls", ReadOnly:=True)
This then becomes the active wb, at front, so I currently use an activate command to flick back to my prime wb. Is there any way to open workbooks but not have them becoming active, to front?