sort a range

  • Thread starter Thread starter Maileen
  • Start date Start date
M

Maileen

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
 
Hi
try to record a macro whild applying your sort criteria manually
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top