+ Reply to Thread
Results 1 to 5 of 5

Data Sort Code Issue

  1. #1
    Registered User
    Join Date
    08-24-2007
    MS-Off Ver
    14.0
    Posts
    69

    Data Sort Code Issue

    Greetings,

    I have inserted the following code for sorting data in a worksheet that goes berserk each time I try to change data on the worksheet. Any advice on why this is happening?

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Range("A1:C56").Sort _
    Key1:=Range("A1"), Order1:=xlDescending, Header:=xlYes
    End Sub

    Your responses are much appreciated!

    -Tommy

  2. #2
    Registered User
    Join Date
    08-24-2007
    MS-Off Ver
    14.0
    Posts
    69

    Re: Data Sort Code Issue

    My apologies - the version I have is 2012 MS Office..
    -Tommy

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Data Sort Code Issue

    Guess this will do

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    08-24-2007
    MS-Off Ver
    14.0
    Posts
    69

    Re: Data Sort Code Issue

    That did it, Mike!

    Thank you very much.

    -Tommy

  5. #5
    Registered User
    Join Date
    08-24-2007
    MS-Off Ver
    14.0
    Posts
    69

    Re: Data Sort Code Issue

    Here's a follow-up question: How can the code be modified to show blank cells withing the sorting range? For example, if I change the code to show data in ascending order, how do I modify the code to show no values at the top of the list?

    -Tommy

+ 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