title: How to sort an Excel sheet by two different columns
body: <p>Let's assume a chart with only values in the first two columns A and B like this </p>
  
  <p><a href="https://i.stack.imgur.com/dP2tw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dP2tw.png" alt="enter image description here"></a> </p>
  
  <p>First I'd like to sort the chart alphabetically by column A, i.e. the Xs at top, then the Ys and the Zs. </p>
  
  <p>The 2nd move should be a sorting of column B considering column A, i.e. keeping the block of Xs and sort their numbers in column B. The same with the blocks of Y and Z. </p>
  
  <p>The 1st step works fine with the following code:</p>
  
  <pre><code>Sub sort()
  Dim SortClmn As String
  Dim Area As String
  Area= "A1:B10"
  SortClmn = "A"
  ActiveSheet.Range(Area).Sort _
  Key1:=Range(SortClmn &amp; "1"), Order1:=xlDescending, _
  Header:=xlGuess, MatchCase:=False, _
  Orientation:=xlTopToBottom
  End Sub
  </code></pre>
  
  <p>How do I need to change this code to apply the 2nd step?</p>
  
  <p>Thanks in advance</p>