Thread: Sort Problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_339_] Leith Ross[_339_] is offline
external usenet poster
 
Posts: 1
Default Sort Problem


Hello Patrick,

The code as it is written is defaulting to the ActiveSheet
(Range("A3:h1301").Select). Notice the words Select and Selection in
the code are not qualified with a worksheet name. Without the
qualifier, the system defaults to the ActiveSheet. Here is the amended
code.
_____________________

Dim SH As Worksheet

For Each SH In ActiveWorkbook.Worksheets

SH.Range("A3:h1301").Sort Key1:=Range("A4"), Order1:=xlAscending,
Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Next SH
_____________________

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=488326