Multiple If Statements or Macro's in Worksheet:View Code
Hello,
I am trying to sort two different areas in one worksheet. I am trying to
use the following code but it only works for the first area not the second.
Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("h3:n500"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("h3:n500").Sort Key1:=Range("h3")
Application.EnableEvents = True
If Intersect(Range("p3:t500"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("p3:t500").Sort Key1:=Range("p3")
Application.EnableEvents = True
End Sub
|