sorting data
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Sorting data

Sorting data

resolvedResolved · High Priority · Version 2007

replyReplyMon 19 Jul 2010, 17:10Delegate Mimi said...

Sorting data

Hi,

I am trying to sort some data within my worksheet.

There are headings in rows 1, columns A to J.
I would like to sort data in ascending order for (in ascending order): column C then
column D.

My code is below:
Selection.CurrentRegion.Select
Selection.sort key3:=Range("c1"), order3:=xlAscending, key4:=Range("d1"), order4:=xlAscending, Header:=xlGuess, ordercustom:=1

When I run this I get an error: run time error '1004'.
"Application-defined or object-defined run time error"

Thanks for any advice!

Mimi

For upcoming training course dates see: Pricing & availability

replyReplyTue 20 Jul 2010, 13:50Trainer Stephen said...

RE: sorting data

Hi Mimi

Thanks for your question

If you replace Key 3 and 4 with key 1 and 2 then it seems to work fine. You can only sort by up to three keys. You also need to rename 0rder 3 and 4 order 1 and 2 as well

Regards

Stephen

Mon 26 Jul 2010: Automatically marked as resolved.

 

 

Please browse our web site to find out more about
microsoft+excel+course and other Microsoft training courses.

Excel tip:

Fill formulae across a sheet

To copy a formula down a spreadsheet where there is data underneath, to the left or to the right of the formula, double-click on the fill handle. The fill handle is the little black cross that appears in the bottom right-hand corner of the formula cell. Unfortunately, no similar facility exists to copy formulae across the sheet.

One reasonably quick way to copy an existing formula across a sheet is to select the formula and the cells on the right to which you want to copy it. Then press Ctrl+R to copy the formula across the selected range, or, if you are menu-minded, use the Edit|Fill|Right command.

View all Excel hints and tips

forum postWhat is advanced filtering?

» Forum post: Excel


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training