title: '1004': "The sort reference is not valid."
body: <p>I am trying to sort a range within a separate sheet. 
  However, I keep getting this message:</p>
  
  <pre><code> '1004': "The sort reference is not valid. Make sure it's within the data you want to sort, and the first Sort By box isn't the same or blank. 
  </code></pre>
  
  <p>I have checked the ranges and they all exist and are working.</p>
  
  <p>The code is below:</p>
  
  <pre><code>Dim EmpBRange As String
  
  EmpBRange = Sheets("EmployeeData").Cells(Cells.Rows.Count, "B").End(xlUp).Row
  
  Worksheets("EmployeeData").Range("K3:K" &amp; EmpBRange).Sort Key1:=Range("K3:K" &amp; EmpBRange), Order1:=xlAscending, Header:=xlGuess, _
         OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
         DataOption1:=xlSortNormal
  </code></pre>
  
  <p>Thanks in advance</p>