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: 12
Default Sort by a Variable Range

I have numerous worksheets that I would like to sort using a variable range.
I will always sort by the last column in ascending order.

I have included the following code in my Macro

Range(" & AllData.Address & ").Sort Key1:=Range(" & FormulaCell.Address &
"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

The AllData variable was defined as a range and selects all the data I would
like to sort. The FormulaCell variable is set as my sort key. Any thoughts
on why I would receive the following error.

Run-time error '1004': Method 'Range' of object '_Global' failed
 
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
Macro to sort variable data range fails Kiwipingu Excel Discussion (Misc queries) 1 June 3rd 10 10:16 PM
Macro to Sort A-Z a variable range of cells Keith B Excel Discussion (Misc queries) 1 September 9th 09 03:31 AM
VBA Variable Range Sort Tony Excel Discussion (Misc queries) 4 April 9th 09 08:21 PM
Sort variable range in descending order J.W. Aldridge Excel Programming 3 March 19th 09 06:36 PM
Set variable sort range based on found text jeffbert Excel Programming 1 June 20th 06 10:14 PM


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