LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default how to define a range in VBA

I'm trying to create a VBA small program for sorting a range by 3
paramters by using the Recording Macro tool. the table to sort is
varying by the rows each between sorts.

Before the begining of the recording I choose the active cell to be on
the table header row and then entered the following sequensce:
<end <left arrow <shift<end<down arrow (while continue holding
the <shift) <left aroow 13 times - to reach the right botom of the
table (some of the culomns are not filled) and then I did the sorting.

following is what was actually recorded:

Selection.End(xlToLeft).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Range("A1:N1511").Select
Selection.Sort Key1:=ActiveCell.Offset(0, 11).Range("A1"),
Order1:= _
xlAscending, Key2:=ActiveCell.Offset(0, 13).Range("A1"),
Order2:=xlAscending _
, Key3:=ActiveCell.Offset(0, 8).Range("A1"),
Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal,
DataOption3:= _
xlSortNormal
End Sub

in the 3rd row the range was transormed to fix range (?)

how to fix it?


Negda

 
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
Define Name range Gotroots Excel Discussion (Misc queries) 10 December 19th 09 11:30 AM
Define a range jlclyde Excel Discussion (Misc queries) 2 April 17th 08 08:26 PM
how to define a range Negda Excel Programming 1 July 19th 07 01:22 PM
Define Range in VBA loopoo[_15_] Excel Programming 2 November 22nd 05 01:38 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM


All times are GMT +1. The time now is 10:01 PM.

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"