Hi Folks,
I have some code that sorts data in range S2:Z10. The data is sorted first by column Y then by column U.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Set Rng = Intersect(Target, Range("Y1:Y10"))
If Rng Is Nothing Then Exit Sub
Rng.Sort Key1:=Range("Y2"), Order1:=xlAscending, _
Key2:=Range("U2"), Order2:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
End Sub
The problem is that all of the data in that range is pulled through from other worksheets. This means that the data changes but it doesn't sort it until I double click on a cell in the range and hit enter. Is there anyway to get the range to auto sort when the data in the range changes even though no it actually clicking on any cell in the range and hitting enter.
Thanks in advance.
Dec
Bookmarks