Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Sorting w/Macros

I know how to set the "KeyX:=Range" using a variable, but is there any
way I can also set the "OrderX" value (either xlAscending or
xDecending) using a variable?
-pb

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting w/Macros

dim lOrder as Long, rng as Range

lOrder = xlAscending

set rng = Range("C1")

Range("A1").Currentregion.Sort Key1:=rng, _
Order1:=lOrder, Header:=xlYes

--
Regards,
Tom Ogilvy


"cubbybear3" wrote in message
ups.com...
I know how to set the "KeyX:=Range" using a variable, but is there any
way I can also set the "OrderX" value (either xlAscending or
xDecending) using a variable?
-pb



Reply
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
Macros for sorting data Angie Luscomb Excel Worksheet Functions 1 February 9th 08 05:55 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Sorting columns with macros John Wilson Excel Programming 1 August 13th 03 06:06 PM
Sorting columns with macros John Waupotic Excel Programming 0 August 13th 03 04:56 PM
help with dataform and sorting macros Beth Mc[_2_] Excel Programming 3 August 1st 03 02:30 AM


All times are GMT +1. The time now is 10:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"