![]() |
how do i get columns in Excell to auto-adjust
I want to be able to add an option of adjusting a spreadsheet in Excel 2003by
clicking on an arrow at the top of each column that will change the entire sheet to fit the requested order of that specific column. For example: i have a column in my spreadsheet that contains 5 different vendors; I have 75 rows in this column. I want to be able to add an arrow box at the top of the column to arrange the entire spreadsheet according to the alphabetical order of this one column |
how do i get columns in Excell to auto-adjust
Jason
I don't know what you mean by this "arrow" thing. The following macro will sort the entire range by the column you choose. You choose the column by clicking on the header of that column. That's all that you have to do. I assumed that row 1 is the header row, that your data goes as far down as Column A does, and that your data is 9 columns wide. Change these things as needed. HTH Otto Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim rColA As Range If Target.Count 1 Then Exit Sub If Target.Row = 1 Then If Target.Column Cells(1, Columns.Count).End(xlToLeft).Column Then _ Exit Sub Set rColA = Range("A1", Range("A" & Rows.Count).End(xlUp)) rColA.Resize(, 9).Sort Key1:=Cells(2, Target.Column), _ Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End If End Sub "jasonprouse" wrote in message ... I want to be able to add an option of adjusting a spreadsheet in Excel 2003by clicking on an arrow at the top of each column that will change the entire sheet to fit the requested order of that specific column. For example: i have a column in my spreadsheet that contains 5 different vendors; I have 75 rows in this column. I want to be able to add an arrow box at the top of the column to arrange the entire spreadsheet according to the alphabetical order of this one column |
how do i get columns in Excell to auto-adjust
Select all columns in your range to sort.
Then DataSort on the column of vendors. Gord Dibben MS Excel MVP On Fri, 22 Aug 2008 11:38:01 -0700, jasonprouse wrote: I want to be able to add an option of adjusting a spreadsheet in Excel 2003by clicking on an arrow at the top of each column that will change the entire sheet to fit the requested order of that specific column. For example: i have a column in my spreadsheet that contains 5 different vendors; I have 75 rows in this column. I want to be able to add an arrow box at the top of the column to arrange the entire spreadsheet according to the alphabetical order of this one column |
how do i get columns in Excell to auto-adjust
jasonprouse wrote:
I want to be able to add an option of adjusting a spreadsheet in Excel 2003by clicking on an arrow at the top of each column that will change the entire sheet to fit the requested order of that specific column. For example: i have a column in my spreadsheet that contains 5 different vendors; I have 75 rows in this column. I want to be able to add an arrow box at the top of the column to arrange the entire spreadsheet according to the alphabetical order of this one column Could an AutoFilter be what you are looking for? |
All times are GMT +1. The time now is 04:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com