Paste this into Excel as is to see:
year Value1 Value2 Value3 Value4 Value5 Value6 Value7 Value8 Value9
2005 2.51 2.42 2.84 2.02 2.77 2.92 8.80 8.71 2.16
2004 2.50 2.70 2.00 2.50 3.10 8.80 8.40 1.90
2003 2.50 2.60 1.80 2.50 3.00 8.80 8.00 1.80
2002 2.50 1.70 2.80 8.60 7.80 2.00
2001 3.50 8.50 7.80 2.00
2000 1.70 3.50 2.50 8.30 7.70 1.50
1999 2.30 3.00 2.50 8.70 7.60 1.70
1998 3.00 8.70 7.50
1997 2.81 8.86 7.61
1996 3.41 8.60 7.59
Basically, I want to order the values by how many years of data are actually present, so Values 5,7,8 would be sorted to the left, but value 1, which only has one year of data, should be to the extreme right.
Main Topics
Browse All Topics





by: FlysterPosted on 2006-04-25 at 20:07:11ID: 16540734
Not quite sure what you are trying to acomplish. If you want to sort the left colmn, and have the columns sort too, you can use the following macra:
, _
Sub SortColumnMacro()
Range("A2:A11").Select
Range("A1:E11").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
DataOption1:=xlSortNormal
End Sub
The first line selects the ten rows below your header. The second defines the range of columns to the left. Just adjust to the columns you need.
Flyster