+ Reply to Thread
Results 1 to 3 of 3

Problem sorting a single column in a shared workbook

  1. #1
    Registered User
    Join Date
    07-13-2005
    Location
    Strängnäs, Sweden
    Posts
    2

    Problem sorting a single column in a shared workbook

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

    BUT: as soon as I share the workbook (Tools -> Share workbook... -> "Allow..." check box) and do the same thing (sort by my 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.

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Code?

    Hi post your code and we will all have a better chance of helping you!

    Simon

  3. #3
    Registered User
    Join Date
    07-13-2005
    Location
    Strängnäs, Sweden
    Posts
    2

    Code not needed

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1