Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I need to have a script in Excel that would allow the sorting of
columns from column "D" to the column before the last column with data. I do not want the last column sorted. The criteria for the sort is in row 1 (Name of an employee). Additional columns will be inserted between column "D" and the last column so they need to be sorted. I hope this is clear. Can someone please assist me? Thank you! Bernie |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Bernie
How can someone named Bernie NOT know how to do this? ;-) Sub BernieSort() Range(Range(Range("D1"), Range("D1").End(xlDown)), _ Range("D1").End(xlToRight)(1, 0)).Sort _ Key1:=Range("D1"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal End Sub HTH, Bernie MS Excel MVP "Bernie" wrote in message ups.com... I need to have a script in Excel that would allow the sorting of columns from column "D" to the column before the last column with data. I do not want the last column sorted. The criteria for the sort is in row 1 (Name of an employee). Additional columns will be inserted between column "D" and the last column so they need to be sorted. I hope this is clear. Can someone please assist me? Thank you! Bernie |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
LOL, that's because this Bernie is not a genius and you are.
It works perfectly, thank you so much for the help. Bernie Bernie Deitrick wrote: Bernie How can someone named Bernie NOT know how to do this? ;-) Sub BernieSort() Range(Range(Range("D1"), Range("D1").End(xlDown)), _ Range("D1").End(xlToRight)(1, 0)).Sort _ Key1:=Range("D1"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal End Sub HTH, Bernie MS Excel MVP "Bernie" wrote in message ups.com... I need to have a script in Excel that would allow the sorting of columns from column "D" to the column before the last column with data. I do not want the last column sorted. The criteria for the sort is in row 1 (Name of an employee). Additional columns will be inserted between column "D" and the last column so they need to be sorted. I hope this is clear. Can someone please assist me? Thank you! Bernie |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Bernie,
Glad to hear that it worked OK for you. We all have to start with _zero_ experience - soem of us have just been around longer than others.... Bernie "Bernie" wrote in message oups.com... LOL, that's because this Bernie is not a genius and you are. It works perfectly, thank you so much for the help. Bernie Bernie Deitrick wrote: Bernie How can someone named Bernie NOT know how to do this? ;-) Sub BernieSort() Range(Range(Range("D1"), Range("D1").End(xlDown)), _ Range("D1").End(xlToRight)(1, 0)).Sort _ Key1:=Range("D1"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal End Sub HTH, Bernie MS Excel MVP "Bernie" wrote in message ups.com... I need to have a script in Excel that would allow the sorting of columns from column "D" to the column before the last column with data. I do not want the last column sorted. The criteria for the sort is in row 1 (Name of an employee). Additional columns will be inserted between column "D" and the last column so they need to be sorted. I hope this is clear. Can someone please assist me? Thank you! Bernie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Macro Help | Excel Discussion (Misc queries) | |||
Conditional Format as a MACRO | Excel Worksheet Functions | |||
need help righting script to sort rows alphabetically then seperate them to line up | Excel Worksheet Functions | |||
Sort as "reference column" | Excel Discussion (Misc queries) | |||
How do I sort a column of data and have each data row sort accordi | Excel Discussion (Misc queries) |