Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default sort a range

Hi,

I have a table where A1 and B1 contains respectively "Software" and
"Amount".
I would like to sort range (A2:B10) based on ascending sorting of Software.

I tried several things with range("A2:B10").Sort(Key1:=Range("A1")) but
nothing works...

could you help me please ?
thx,
Maileen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default sort a range

Hi
try to record a macro whild applying your sort criteria manually

--
Regards
Frank Kabel
Frankfurt, Germany

Maileen wrote:
Hi,

I have a table where A1 and B1 contains respectively "Software" and
"Amount".
I would like to sort range (A2:B10) based on ascending sorting of
Software.
I tried several things with range("A2:B10").Sort(Key1:=Range("A1"))
but nothing works...

could you help me please ?
thx,
Maileen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default sort a range

Maileen,

The key1 range must be in the range that is sorted. So, use
either

Range("A1:B10").Sort(Key1:=Range("A1")), Header:=True

or

Range("A2:B10").Sort(Key1:=Range("A2"))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Maileen" wrote in message
...
Hi,

I have a table where A1 and B1 contains respectively "Software"
and "Amount".
I would like to sort range (A2:B10) based on ascending sorting
of Software.

I tried several things with
range("A2:B10").Sort(Key1:=Range("A1")) but nothing works...

could you help me please ?
thx,
Maileen



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
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Can I sort by Range Name? DeepSouthRick Excel Discussion (Misc queries) 1 June 2nd 05 03:06 AM
Sort range changes during sort coffedrinker2003 Excel Discussion (Misc queries) 1 May 24th 05 11:53 PM
Sort a Range Brandt Excel Discussion (Misc queries) 5 December 28th 04 10:45 AM
Range.Sort in VBA Martin Los Excel Programming 2 April 29th 04 04:56 PM


All times are GMT +1. The time now is 04:59 PM.

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"