+ Reply to Thread
Results 1 to 6 of 6

Sort using keys not in range

  1. #1
    Registered User
    Join Date
    06-26-2008
    Location
    New Zealand
    Posts
    41

    Question Sort using keys not in range

    Hello, I am trying to sort a column without sorting two other column but using those columns as keys for the sort. But I keep getting a 'Key not in Range' error. Am I trying to do the impossible?

    Please Login or Register  to view this content.
    Cheers!
    Please use code tags when you are using VBA code
    Last edited by davesexcel; 06-26-2008 at 08:22 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480
    Quote Originally Posted by Rhapsodie
    Hello, I am trying to sort a column without sorting two other column but using those columns as keys for the sort. But I keep getting a 'Key not in Range' error. Am I trying to do the impossible?

    Please Login or Register  to view this content.
    Cheers!
    Could you expand on that??

  3. #3
    Registered User
    Join Date
    06-26-2008
    Location
    New Zealand
    Posts
    41
    Ok. I have three columns of data. I only want to sort the third column but i want the sort based on the data in the first then second columns. They key is I do NOT want the whole row sorted. Just the the third column.

    I hope that is clear and would appreciate any help.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480
    Quote Originally Posted by Rhapsodie
    Ok. I have three columns of data. I only want to sort the third column but i want the sort based on the data in the first then second columns. They key is I do NOT want the whole row sorted. Just the the third column.

    I hope that is clear and would appreciate any help.
    Hi Rhapsodie,
    That is what you wrote in your first post........
    How can you sort data based on another column of data?

    If you want to sort data from 3 columns, you would sort from the least relevant to the most relevant....

    And if this doesn't work, Why not just sort the 3rd column?
    Go to Data,Sort, and select the column you want to sort by....

    maybe you mean just sort the 3rd column and no others, then just select the column and sort it...if the program asks you if you want to include the rest of the used range, just say no...

  5. #5
    Registered User
    Join Date
    06-26-2008
    Location
    New Zealand
    Posts
    41
    Yeah thanks. Thought I was asking the impossible. I do just want to sort one column but maybe I'm not explaining it right. I have one column called Customer where every cell has one of four values, A,B,C,D. I have a column next to it called Region where every cell has one of four values, AP, EMEA, US, CALA. I have the column I want to sort called Value. I want to sort only Value so that all the values relating to Customer a come first and are sorted by region. The customer B sorted by region then customer C sorted by region, etc. BUT, as the columns called Customer and Region have values obtained by a VB Function which uses explicit references I must avoid sorting either Colum Customer or colum Region. Does that explain it?

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480
    Quote Originally Posted by Rhapsodie
    Yeah thanks. Thought I was asking the impossible. I do just want to sort one column but maybe I'm not explaining it right. I have one column called Customer where every cell has one of four values, A,B,C,D. I have a column next to it called Region where every cell has one of four values, AP, EMEA, US, CALA. I have the column I want to sort called Value. I want to sort only Value so that all the values relating to Customer a come first and are sorted by region. The customer B sorted by region then customer C sorted by region, etc. BUT, as the columns called Customer and Region have values obtained by a VB Function which uses explicit references I must avoid sorting either Colum Customer or colum Region. Does that explain it?
    Hi,
    Yes, that explains it.
    Please supply a sample workbook for somebody to work with

+ 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