Hi,

I'm new to VB and I'm trying to sort a region of data in Excel using the following code

Sheets(1).Range("A6").Select
ActiveCell.CurrentRegion.Select
Selection.Sort Key1:=Range("H2"), Order1:=xlAscending, _
Key2:=Range("D2") , Order2:=xlAscending, Key3:=Range("B2"), _
Order3:=xlAscending, Header:= xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,_
DataOption2:=xlSortNormal, DataOption3:= xlSortNormal

but I keep getting an error message which says 'Identifier under cursor not recognised' and highlights the code in yellow, or which says 'The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank'. I am not that new to sorting data but I've been completely unable to solve this - if anyone has any idea about what this could be, I would greatly appreciate it.

Thanks,

Kerry