Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Can't you copy all into one column, sort it, then copy it back in pieces into the five columns. regards Paul On Mar 21, 2:39 pm, K wrote: Hi there, I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How many names are in each column and how are they seperated? Are there just
blanks between the names? what should the results look like? "K" wrote: Hi there, I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SortRows()
'Tom Ogilvy macro Dim r As Long Dim Lrow As Long Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row 'Make the r = 1 whatever the first row of data you want to sort on is. 'The Cells(r, 1) means your data starts in Col 1 or Col A - adjust as 'necessary 'The resize(1, 5) expands the range to 1 cell deep by 5 cells wide For r = 1 To Lrow With Cells(r, 1).Resize(1, 5) .Sort Key1:=Cells(r, 1), Order1:=xlAscending, Header:=xlGuess, _ Orientation:=xlLeftToRight, DataOption1:=xlSortNormal End With Next r Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Gord Dibben MS Excel MVP On Wed, 21 Mar 2007 07:39:08 -0700, K wrote: Hi there, I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
great
thanks k "Gord Dibben" wrote: Sub SortRows() 'Tom Ogilvy macro Dim r As Long Dim Lrow As Long Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row 'Make the r = 1 whatever the first row of data you want to sort on is. 'The Cells(r, 1) means your data starts in Col 1 or Col A - adjust as 'necessary 'The resize(1, 5) expands the range to 1 cell deep by 5 cells wide For r = 1 To Lrow With Cells(r, 1).Resize(1, 5) .Sort Key1:=Cells(r, 1), Order1:=xlAscending, Header:=xlGuess, _ Orientation:=xlLeftToRight, DataOption1:=xlSortNormal End With Next r Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Gord Dibben MS Excel MVP On Wed, 21 Mar 2007 07:39:08 -0700, K wrote: Hi there, I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And thanks to Tom.
Gord On Wed, 21 Mar 2007 13:40:46 -0700, K wrote: great thanks k "Gord Dibben" wrote: Sub SortRows() 'Tom Ogilvy macro Dim r As Long Dim Lrow As Long Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row 'Make the r = 1 whatever the first row of data you want to sort on is. 'The Cells(r, 1) means your data starts in Col 1 or Col A - adjust as 'necessary 'The resize(1, 5) expands the range to 1 cell deep by 5 cells wide For r = 1 To Lrow With Cells(r, 1).Resize(1, 5) .Sort Key1:=Cells(r, 1), Order1:=xlAscending, Header:=xlGuess, _ Orientation:=xlLeftToRight, DataOption1:=xlSortNormal End With Next r Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Gord Dibben MS Excel MVP On Wed, 21 Mar 2007 07:39:08 -0700, K wrote: Hi there, I have about 5 equal columns of names that I need to sort alphabetically accross the columns. I don't want to put it into one column because I want to use the width of the screen. Is it possible to do a macro to sort this. I can't seem to do it from the menus. Has anyone any suggestions. Thanks in advance for any help Kerry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUM IF sum of two collumns | Excel Discussion (Misc queries) | |||
I want sort a list but the sort is unlit on the home tab how do I | Excel Worksheet Functions | |||
How do I sort collumns and leave out pictures in rows not used? | Excel Worksheet Functions | |||
Collumns | Excel Discussion (Misc queries) | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) |