davidmyers

Board Regular
Joined
Jan 29, 2017
Messages
88
Office Version
  1. 2016
Platform
  1. Windows
Hi I'm trying to sort a WorkSheet with the following code:

Code:
Sub SortComplaintsSystemWithinSpecies()
Dim sortSystemInSpecies As Range
Dim keySystem As Range
Dim keySpecies As Range
Set sortSystemInSpecies = Sheets("Complaints").Range("B2", Range("Q" & Rows.Count).End(xlUp))
Set keySystem = Sheets("Complaints").Range("I2")
Set keySpecies = Sheets("Complaints").Range("C2")
With sortSystemInSpecies
    .Sort Key1:=keySpecies, Order1:=xlAscending, _
          key2:=keySystem, order2:=xlAscending, Orientation:=xlSortColumns, Header:=xlYes
   '        key3:=.Cells(1, 1), order3:=xlAscending, Header:=xlGuess
End With
End Sub

Is there any reason this does not work and no errors are displayed?

Thanks for any Help
David
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Sorry if anybody's spending time on this to find the problem.

Checking in the light of day - actually realized at 5am that maybe I'd been looking at the wrong sorted column - I see it all works as intended.

I think what threw me was it worked so fast, I assumed nothing happened.

David
 
Upvote 0

Forum statistics

Threads
1,215,588
Messages
6,125,692
Members
449,250
Latest member
azur3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top