I currently can make these formulas work independently, but I would like to combine them. If checkbox in column 15 is true or if cell in colum 16 is not empty, that the row will be moved after the last row.
Also if possible, how could I make that the rows are moved 10 rows after the last row, and that subsequent lowered rows will go after that one etc..
Formula 1:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long
If Target.CountLarge > 1 Then Exit Sub
If Target.Column <> 15 Then Exit Sub
If Target.Value = True Then
r = Target.Row
Application.EnableEvents = False
Rows(r).Cut
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Rows(r).Delete
Application.EnableEvents = True
End If
End Sub
Formula 2:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long
If Target.CountLarge > 1 Then Exit Sub
If Target.Column <> 16 Then Exit Sub
If Target.Value <> " " Then
r = Target.Row
Application.EnableEvents = False
Rows(r).Cut
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Rows(r).Delete
Application.EnableEvents = True
End If
End Sub
Thanks
Also if possible, how could I make that the rows are moved 10 rows after the last row, and that subsequent lowered rows will go after that one etc..
Formula 1:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long
If Target.CountLarge > 1 Then Exit Sub
If Target.Column <> 15 Then Exit Sub
If Target.Value = True Then
r = Target.Row
Application.EnableEvents = False
Rows(r).Cut
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Rows(r).Delete
Application.EnableEvents = True
End If
End Sub
Formula 2:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long
If Target.CountLarge > 1 Then Exit Sub
If Target.Column <> 16 Then Exit Sub
If Target.Value <> " " Then
r = Target.Row
Application.EnableEvents = False
Rows(r).Cut
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Rows(r).Delete
Application.EnableEvents = True
End If
End Sub
Thanks