Thread: Sorting
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Sorting


It could be that they are not selecting a range with column C in it.
Try adding a dot "." ahead of all three column designations.
That way the sort will take place relative to the selection.
Column C will then be the third column of the selection (not the worksheet).
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"peyman"
wrote in message
hi,
I've a macro for sorting a selected range in a worksheet.the workbook is
shared.the problem is when I sort it in my file, the macro works well but for
the other users the range is not sorted?!

Sub Rectangle1954_Click()
Dim myRng As Range
Set myRng = Selection.Areas(1)
With myRng

.Sort key1:=Columns("C"), order1:=xlAscending, DataOption1:=xlSortNormal,_
key2:=Columns("B"), order2:=xlAscending, DataOption2:=xlSortTextAsNumbers,_
Key3:=Columns("F"), order3:=xlAscending, DataOption3:=xlSortNormal

End With
End Sub
any help?
thank you for your time.