Forum Discussion
Tiffany Gaquin
Apr 24, 2018Copper Contributor
VBA to Move rows in a sheet based on the project Status
I am working on a spread sheet that is a list of projects. Basically once a project is completed, i want to move that entire row to a completed projects sheet, and delete the row from the sheet it's ...
Matt Mickle
Apr 25, 2018Bronze Contributor
Tiffany-
I have attached a sample workbook for your reference. You will need to paste this code in the Project List worksheet code module in the attached file for it to work properly:
1. Alt + F11 (Access VBE)
2. Double click the icon in the Project Explorer that says Project List
3. Paste the code
Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next Application.EnableEvents = False 'If Cell that is edited is in column U and the value is completed then If Target.Column = 21 And Target.Value = "Completed" Then 'Define last row on completed worksheet to know where to place the row of data LrowCompleted = Sheets("Completed").Cells(Rows.Count, "A").End(xlUp).Row 'Copy and paste data Range("A" & Target.Row & ":U" & Target.Row).Copy Sheets("Completed").Range("A" & LrowCompleted + 1) 'Delete Row from Project List Range("A" & Target.Row & ":U" & Target.Row).Delete xlShiftUp End If Application.EnableEvents = True End Sub
Please note that you may need to adjust the worksheet names in the VBA code based on your actual worksheet names.
BrandonDeen1985
Jan 09, 2020Copper Contributor
Great providing this outstanding Project to the Excel community. I have mine all setup but is there a way to have the exact same setup with using Share Mode.