sorting on a non active sheet
I feel very foolish asking this question but I have been going round and
round on this too long. I have the following code in a Userform (not in a
module):
Sheets(1).Activate
Sheets(1).Range(Cells(3,1),Cells(15,20)).Select
Selection.sort Key1:=Range(A2), Order1:=xlAscending _
, Key2:=Range(D2), Order2:=xlAscending _
, Header:=xlGuess, OrderCustom:=1, MatchCase:=False _
, Orientation:xlTopToBottom
The code works fine.
However, I now want to do the sort without activating sheet(1). I have
tried all kinds of ways to do the ranges without using selection but to no
avail. I went thru the postings and could not find another posting close to
this. Can someone help me.
--
russ
|