Hi
Can any help me please. I'm trying to automatically sort a column in alphabetical order using the following code
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("U:U")) Is Nothing Then
Range("IU1").Sort Key1:=Range("U2"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
My data is in column "U" ... I used a similar code to automatically sot another worksheet in date order an it works perfectly.
When I first used the "Alphabetical" coding (which is the essence of my plea for help) it worked, but then I had to delete it (stupidly) and when I tried it again, it doesn't work.
Any help will be appreciated.
Toncar
Can any help me please. I'm trying to automatically sort a column in alphabetical order using the following code
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("U:U")) Is Nothing Then
Range("IU1").Sort Key1:=Range("U2"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
My data is in column "U" ... I used a similar code to automatically sot another worksheet in date order an it works perfectly.
When I first used the "Alphabetical" coding (which is the essence of my plea for help) it worked, but then I had to delete it (stupidly) and when I tried it again, it doesn't work.
Any help will be appreciated.
Toncar