I have a worksheet "OPEN", and would like to apply both:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim i As Long
Set rng = Target.Parent.Range("B:B")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) Is Nothing Then Exit Sub
If LCase(Target.Value) = "closed" Then
i = Target.Row
Target.EntireRow.Cut Sheets("CLOSED").Cells(Rows.Count, "A").End(xlUp).Offset(1)
Cells(i, "B").EntireRow.Delete
End If
End Sub
and
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Range("A2:L100").Sort _
Key1:=Range("B1"), Order1:=xlAscending, _
Key2:=Range("A1"), Order2:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
The first removes the rows if the validated column 'B' is equal to "closed", to a second worksheet "CLOSED". The second orders the rows by the same column, followed by column 'A'. Being brand new to macros, I've no clue how to make this happen... or if it's even possible...any help would be greatly appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim i As Long
Set rng = Target.Parent.Range("B:B")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) Is Nothing Then Exit Sub
If LCase(Target.Value) = "closed" Then
i = Target.Row
Target.EntireRow.Cut Sheets("CLOSED").Cells(Rows.Count, "A").End(xlUp).Offset(1)
Cells(i, "B").EntireRow.Delete
End If
End Sub
and
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
Range("A2:L100").Sort _
Key1:=Range("B1"), Order1:=xlAscending, _
Key2:=Range("A1"), Order2:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
The first removes the rows if the validated column 'B' is equal to "closed", to a second worksheet "CLOSED". The second orders the rows by the same column, followed by column 'A'. Being brand new to macros, I've no clue how to make this happen... or if it's even possible...any help would be greatly appreciated!