LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default Variable Column Sort

The following starts in column B (2). It asks for the last column number and
will then individually sort each column between column 2 and the supplied
column number:

Sub gsnu()
n = Application.InputBox("enter last column number to be sorted:", 1)
For i = 2 To n
Columns(i).Sort Key1:=Cells(1, i)
Next
End Sub

--
Gary's Student


"Bernie" wrote:

I need to aIphabetize columns with a set start column, but a variable
range for the end column.


Thanks,
Bern


 
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
How do I combine spreadsheets and documents in one file? Trish Excel Discussion (Misc queries) 3 November 9th 06 09:17 PM
Sort Excel Column on Fifth Character Dolores Excel Worksheet Functions 2 December 27th 05 10:59 PM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
How do I sort a column of formulas in Excel? Gordon Excel Discussion (Misc queries) 2 November 27th 04 01:55 AM
How do I sort a column of formulas in Excel? Gordon Excel Discussion (Misc queries) 0 November 26th 04 03:19 PM


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