Problem sorting a single column in a shared workbook

H

hakask

I´m using the sort method to do a simple sorting in a column. It work
fine by vba sort method (Works fine sorting from menu also afte
selecting a column). The single column (and only that one) is sorte
ok.

BUT: :confused: as soon as I share the workbook (Tools -> Shar
workbook... -> "Allow..." check box) and do the same thing (sort by m
vba sort method or from menue) ALL columns on that sheet are sorted
not only the selected column.

Is this a bug, or how can I get around this behaviour?

Have got Excel 2000 on a Win2000 machine
 
H

hakask

Well, code is not needed as the results are the same if code is used or
sorting from the menue, but here is a quick example code:

Say that you have data ("SORT") in F column and data numeric (1234) in
G column:

Row 4: S : 1
Row 5: O : 2
Row 6: R : 3
Row 7: T : 4

Call a simple sub:
Sub sortColData()
Range("F4:F7").Select
Selection.Sort Key1:=Range("F4"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlSortColumns

End Sub

The result is:

Row 4: O : 1
Row 5: R : 2
Row 6: S : 3
Row 7: T : 4

Fine!

But in a shared workbook the result is:
Row 4: O : 2
Row 5: R : 3
Row 6: S : 1
Row 7: T : 4

Same code (or same menue choice), but different results. :eek:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top