View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ludo Ludo is offline
external usenet poster
 
Posts: 74
Default Sort in hidden page crach

On 21 mei, 15:57, Claus Busch wrote:
Hi Ludo,

Am Mon, 21 May 2012 06:27:44 -0700 (PDT) schrieb Ludo:

* * With ThisWorkbook.Sheets("common settings").Range("T1" )
* * * * .Cells.Sort Key1:=Sheets("common settings").Range("T1"),
Order1:=xlAscending, Header:=xlNo, _
* * OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
DataOption1:=xlSortTextAsNumbers
* * End With


try:
With ThisWorkbook.Sheets("common settings")
* * Range("T1").Sort Key1:=.Range("T1"), Order1:=xlAscending, _
* * * * Header:=xlNo, OrderCustom:=1, Orientation:=xlTopToBottom, _
* * * * * * DataOption1:=xlSortTextAsNumbers
End With

Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


Thanks Claus for the fast reply.

But there's still an error message (method of Class sort failed).
error 1004.


When i place a point (.) before the word Range, it works great, see
code below.

With ThisWorkbook.Sheets("common settings")
.Range("T1").Sort Key1:=.Range("T1"), Order1:=xlAscending, _
'added a point (.) just before the word Range.
Header:=xlNo, OrderCustom:=1, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End With

Thanks again,
Ludo