Editing a macro
Hi all - hoping someone can help me with this relatively simple macro edit that I can't get my head around!
I have downloaded a to-do list macro and think it's great but would like to change one aspect. There's a functionality button that when clicked deletes all 'completed' tasks (i.e. ones that you've double-clicked and put a line through). Instead of deleting these tasks, I'd like to edit the macro instruction to cut and paste those 'completed' tasks with a line through them into a new worksheet that I'd name 'Completed tasks'. This would therefore keep a list of all tasks completed over the year.
The macro behind the button is this:
Sub DeleteCompleted()
Dim Test1 As ListObject
Dim Test2 As Variant
Dim Rowcount As Integer
Set Test1 = Sheets("To Do List").ListObjects("Table2")
Test2 = Test1.ListRows.Count
For Rowcount = 1 To Test2 Step 1
If Test1.DataBodyRange(Rowcount, 4) = "Completed" Then
Test1.DataBodyRange(Rowcount, 4).Delete Shift:=xlUp
Rowcount = 0
End If
Next Rowcount
End Sub
Sub LoadForm()
AddTask.Show
End Sub
I've tried playing around with this without any success. Mostly arounding changing the word 'Delete'.
Hoping someone can help!
Many thanks
Noob
Recent comments
5 years 42 weeks ago
6 years 28 weeks ago
6 years 40 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 49 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago