I´m trying to include the first row ("E1) to be sorted as well in the following code. I know that it has to be something really simple, but I cannot manage it. Any suggestion how can I do it?
'Sort value=1
'Find first row with value=1 in column E
With ws
FstRowSub = .Range("E:E").Find(What:=1, After:=.Range("E1")).Row
'Find last row with value=1 in column E
LastRowSub = .Range("E:E").Find(What:=1, After:=.Range("E1"), searchdirection:=xlPrevious).Row
'Set range which includes rows with value=5 in column E
Set rngSub = .Range(Cells(FstRowSub, "A"), Cells(LastRowSub, LastColumn))
'Sort the range based on the data in column B (value=1)
rngSub.Sort _
key1:=.Range("B1"), _
order1:=xlAscending, _
Header:=xlNo