LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default range definition by cells numbers

Hi,

Am Fri, 19 Oct 2012 13:35:45 -0700 (PDT) schrieb tuli:

Dim AKO As Range
Dim BKO as Range
Set AKO = Range(Sheet3.Cells(2, 13), Sheet3.Cells(362, 66)) 'Range("M2:M362")
Set BKO = Range(Sheet3.Cells(2, 13), Sheet3.Cells(362, 13)) 'Range("M2:M362")


try:
Set AKO = Sheets("Sheet3").Range(Cells(2, 13), Cells(362, 13))
or:
Set AKO = Sheets("Sheet3").Range("M2:M362")

change your code:

Dim AKO As Range
Dim BKO As Range

With Worksheets("RESULTS")
Set AKO = .Range(Cells(2, 13), Cells(362, 13))
Set BKO = Range(Cells(1, 1), Cells(362, 13))

.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=AKO _
, SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With .Sort
.SetRange BKO
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
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
Range definition thewizz Excel Programming 2 October 29th 07 06:22 PM
Range Definition [email protected] Excel Programming 1 December 15th 06 11:28 AM
Using Address in Range Definition?? Don G Excel Programming 4 April 1st 06 01:18 AM
How come this range definition is invalid? keepITcool Excel Programming 1 June 21st 04 07:15 PM
Using Cells( ) for Range definition [email protected] Excel Programming 5 September 2nd 03 08:04 PM


All times are GMT +1. The time now is 02:43 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"