Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 10th, 2007, 05:46 AM
Authorized User
 
Join Date: Apr 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sorting the columns

I want to sort a column in excel. Please suggest a vba macro statement for this.

Yogesh
__________________
Yogesh
 
Old December 10th, 2007, 07:07 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

The range sort has several parameters besides the ones in my example that you can use/change. Try the help file in the VBA editor for more information. For the keys, use the top row as the # and the letter or the column you want to sort. Play around with it for a while and I'm sure you'll get the hang of it.

------------------------------------
Range("A:IV").Sort Key1:=Range("A1"), Key2:=Range("B1"), Key3:=Range("C1")
------------------------------------

Hope this helps point you in the right direction.






Similar Threads
Thread Thread Starter Forum Replies Last Post
sorting member XSLT 25 July 13th, 2007 08:44 AM
Problem with sorting asp:tablecell columns rrajeshbe ASP.NET 2.0 Basics 0 June 1st, 2006 08:28 AM
Sorting sunny76 Excel VBA 2 September 19th, 2005 09:31 PM
Sorting of columns in Datagrid lily611 General .NET 2 July 21st, 2005 07:50 AM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.