jwilliamson
New Member
- Joined
- Apr 1, 2019
- Messages
- 7
I'm looking to move rows to another sheet when a value in "H" is changed to "closed"
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If LCase(Target.Value) = "closed" Then
Target.EntireRow.Cut Sheets(2).Cells(Rows.Count, 1).End(xlUp)(2)
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim lr As Long
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If LCase(Target.Value) = "closed" Then
lr = Sheets(2).Cells.Find("*", , xlValues, xlPart, xlByRows, xlPrevious).Row + 1
Target.EntireRow.Cut Sheets(2).Cells(lr, 1)
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim lr As Long
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If Target <> "" Then
If LCase(Target.Value) = "closed" Then
lr = Sheets(2).Cells.Find("*", , xlValues, xlPart, xlByRows, xlPrevious).Row + 1
Target.EntireRow.Cut Sheets(2).Cells(lr, 1)
End If
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim lr As Long
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If Target <> "" Then
If LCase(Target.Value) = "closed" Then
If Application.CountA(Sheets(2).Rows(1)) = 0 Then
Target.EntireRow.Cut Sheets(2).Range("A1")
Else
lr = Sheets(2).Cells.Find("*", , xlValues, xlPart, xlByRows, xlPrevious).Row + 1
Target.EntireRow.Cut Sheets(2).Cells(lr, 1)
End If
End If
End If
End If
End Sub