title: Sorting lists with keys vba
body: <p>I am writing something to sort the data between A2 and the end of the data in F. The sort will first sort F using a custom array order, then sort A alphabetically within the F order. At the moment i'm getting the error "Expected end of statement" for Key1 but i'm not sure why this is. is there something i'm missing to be able to use sort keys?</p>
  
  <pre><code>Sub Sort_Data()
  
  Dim lstrw As Integer
  
  
      lstrw = Range("A2").End(xlDown).Row
  
      With  Range("A2", Cells(lstrw, "F")).Sort Key1:=Range("F2"), CustomOrder1:="OFDB,CSTM,*FS", _
             key2:=Range("A2"), order2:=xlAscending, _
             Header:=xlNo
      End With
  
  End Sub
  </code></pre>