View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Daniel.C[_2_] Daniel.C[_2_] is offline
external usenet poster
 
Posts: 105
Default excel 2007 sorting

Try :

i = 1
For Each c In [A1:J1]
If c.Value < "" Then
i = i + 1
Cells(i, 1) = c.Value
End If
Next c
[A1:J1].ClearContents
Range("A2", Range("A65000").End(xlUp)).Sort Key1:=Range("A2"), _
Order1:=xlAscending, Header:=xlNo, DataOption1:=xlSortNormal
i = 1
For Each c In Range("A2", Range("A65000").End(xlUp))
Cells(1, i) = c.Value
i = i + 2
Next c

Regards.
Daniel

excel 2007 sorting leaving blanks where they are left to rigth eg
1_3_6_2_9_4_ and when your sort i want
1_2_3_4_6_9_ Line represents blank cell