Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Sorting columns left to right leave a intact

I have a sheet with the following

column a = 3 digit zip

column b, c, d, & contain a text territory designation

a b c d e
Example: 917 SE/PR W7 W8 W9

I need the columns b to e to be sorted left to right
alphabetically.

so "701 SE8 SE7 E7"

would look like like

701 E7 SE7 SE8

the thing is that you may only have somethin in B or B&C
and then the rest blank.

We are leaving the column A thing where it is.

Thanks for your time.

Todd


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Sorting columns left to right leave a intact

Hi Todd,
Always select your sort area ahead of time. If you rely on
Excel expanding a single cell to the current region
you will invariably get into trouble.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Todd" wrote in message ...
I have a sheet with the following

column a = 3 digit zip

column b, c, d, & contain a text territory designation

a b c d e
Example: 917 SE/PR W7 W8 W9

I need the columns b to e to be sorted left to right
alphabetically.

so "701 SE8 SE7 E7"

would look like like

701 E7 SE7 SE8

the thing is that you may only have somethin in B or B&C
and then the rest blank.

We are leaving the column A thing where it is.

Thanks for your time.

Todd




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sorting columns left to right leave a intact

Assuming your data starts in A1:

Sub SortHorizontal()
For j = 1 To Range("a1").End(xlDown).Row
Range(Cells(j, 2), Cells(j, 5)).Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight
Next j
End Sub

"Todd" wrote in message ...
I have a sheet with the following

column a = 3 digit zip

column b, c, d, & contain a text territory designation

a b c d e
Example: 917 SE/PR W7 W8 W9

I need the columns b to e to be sorted left to right
alphabetically.

so "701 SE8 SE7 E7"

would look like like

701 E7 SE7 SE8

the thing is that you may only have somethin in B or B&C
and then the rest blank.

We are leaving the column A thing where it is.

Thanks for your time.

Todd


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Sorting columns left to right leave a intact

thansk will try tomarrow
-----Original Message-----
Assuming your data starts in A1:

Sub SortHorizontal()
For j = 1 To Range("a1").End(xlDown).Row
Range(Cells(j, 2), Cells(j, 5)).Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending,

Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,

Orientation:=xlLeftToRight
Next j
End Sub

"Todd" wrote in

message ...
I have a sheet with the following

column a = 3 digit zip

column b, c, d, & contain a text territory designation

a b c d e
Example: 917 SE/PR W7 W8 W9

I need the columns b to e to be sorted left to right
alphabetically.

so "701 SE8 SE7 E7"

would look like like

701 E7 SE7 SE8

the thing is that you may only have somethin in B or

B&C
and then the rest blank.

We are leaving the column A thing where it is.

Thanks for your time.

Todd


Reply
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
can you group together rows to remain intact while sorting? justusmomm New Users to Excel 4 April 3rd 23 11:09 AM
Keeping Formulas Intact While Sorting PleaseHelp! Excel Discussion (Misc queries) 2 June 5th 08 02:20 PM
Keeping cell info intact when sorting worksheets w/some linked cel judie Setting up and Configuration of Excel 0 April 1st 07 10:12 PM
Sorting columns while keeping row data intact Paul New Users to Excel 5 February 21st 07 04:41 PM
How do I clear a worksheet of values, but leave formulas intact? [email protected] Excel Worksheet Functions 2 April 18th 05 05:53 PM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"