PDA

View Full Version : Sleeper: ORDERING...



sal21
10-28-2004, 12:51 AM
i use this macro to ordering the column G but tath dont work correctlly...
after to run this macro many number assuming a point and not a comma, why?

In effect i would want to order the columnn G...
If you have another way is welcome...


Sub ORD_ASS_CDI_50()
Sheets("L0785_CDI_50").Select
With Range(Range("G7"), Range("G65536").End(xlUp))
.NumberFormat = "0.00"
.TextToColumns Destination:=Range("G7")
End With
Range("A7:X7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A7").Select
End Sub

HaHoBe
10-28-2004, 09:25 PM
Hi, Sal,

to my opinion the line


.TextToColumns Destination:=Range("G7")

is the line that should be made responsible for the 'strange' behaviour.

The following code worked fine in the workbook:


Sub ORD_ASS_CDI_50_mod()
With Sheets("L0785_CDI_50")
With .Range(.Range("G7"), .Range("G65536").End(xlUp))
.NumberFormat = "0.00"
End With
With .Range(.Range("A7:X7"), .Range("A7:X7").End(xlDown))
.Sort Key1:=Range("G7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
End With
End Sub


Ciao,
Holger