Complaints Department
New Member
- Joined
- Feb 21, 2023
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
Hey all,
I am losing my mind trying to figure this out and after hours of searching online, I couldn't find anything to help.
I need to create a running list for current project statuses. There are two sheets in the document, OUTSTANDING and COMPLETED.
On the OUTSTANDING sheet shown below, I have the subsequent VBA code for when I select "YES" in column D in the relevant row, it will do the following:
However, instead of moving this row to the bottom of this same list, I need the following:
I'd appreciate it if anyone was able to assist!
Thank you in advance!!
I am losing my mind trying to figure this out and after hours of searching online, I couldn't find anything to help.
I need to create a running list for current project statuses. There are two sheets in the document, OUTSTANDING and COMPLETED.
On the OUTSTANDING sheet shown below, I have the subsequent VBA code for when I select "YES" in column D in the relevant row, it will do the following:
- Move that row to the bottom of the list
- Strikethrough the data in that row
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim tbl As ListObject, wRow As Long
Set tbl = ActiveSheet.ListObjects("Table1")
If Target.CountLarge > 1 Then Exit Sub
If Not Intersect(Target, tbl.ListColumns("COMPLETED").Range) Is Nothing Then
If UCase(Target.Value) = "YES" Then
Application.ScreenUpdating = False
wRow = Target.Row - tbl.HeaderRowRange.Row
tbl.ListRows.Add AlwaysInsert:=True
tbl.DataBodyRange.Rows(wRow).Font.Strikethrough = True
tbl.DataBodyRange.Rows(wRow).Copy tbl.DataBodyRange.Rows(tbl.ListRows.Count)
tbl.ListRows(wRow).Delete
End If
End If
End Sub
However, instead of moving this row to the bottom of this same list, I need the following:
- Selecting "YES" will move the row from sheet OUTSTANDING to the top of the list on sheet COMPLETED (see below image for reference)
- Strikethrough the data in that row
- Add in today's date to column E (the date of when "YES" was selected)
- When another row is moved from sheet OUTSTANDING, it will add the new row to the top of the list, and move all other rows down so that the most recent move will remain at the top
I'd appreciate it if anyone was able to assist!
Thank you in advance!!