VBA Question - I need a macro to move rows of data that meet 1 criteria from one table to another.

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
Question/Request

I'd like to have a macro on a button that searches the TaskList table for any rows marked as "Complete"
then copies those rows into the CompletedTask table. After that I'd like to remove the rows marked as "Complete" from my TaskList table. So that after I've hit the button to run the macro the TaskList table only shows my outstanding tasks and my Completed tasks are stored in the CompletedTask table.


VBA is not my strong suit... so I'm really at a loss of where to begin, I've included relevant information below.
Thanks in advance

There are two tables that look identical in my workbook, their components are:

Table 1
Name = TaskList
FileTaskDue DatePriority!StatusNotes
Example FileExample task to be completed2019-11-03Medium5Pending"Intentionally left blank"<intentionally left="" blank=""></intentionally>
2nd FileExample Completed task2019-11-02High11CompleteTask completed with no issues

<tbody>
</tbody>

  • the Exclamation point "!" column is a priority modifier that increases the weight of a task based on whether it's categorized as a low, medium or high priority and then multiplies it based on the days overdue


Table 2

Name = CompletedTask
  • This table looks the exact same as the TaskList Table. It contains only completed tasks after they've been copied over and removed from table 1.

Once again, VBA isn't my strong suit, aside from adding the developer window and using the macro assist tool to record basic macro's I'm not sure how to start.

Thanks again for any advice on this :)
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

Before getting into moving rows from a table to another one ...

Have you tried AutoFilter ?
 

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
There are a few graphs and formulas that are connected to the table, (A bar fills up as tasks become completed for the day)
If I don't remove the tasks from the table than this bar will remain full and the graphs will continuously grow.

These formula's use the # of completed items against the total outstanding for the day.
For example the progress bar formula:

Code:
=IFERROR(COUNTIFS(TaskList[Due Date],"<="&TODAY(),TaskList[Status],"Complete")/COUNTIF(TaskList[Due Date],"<="&TODAY()),"¯\_(ツ)_/¯")

The # of completed items is used by a few other formulas where it's compared to the total items due within the day or overdue. Where the output lets me know what to do next and which project currently needs the most attention.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,812
Messages
5,574,474
Members
412,595
Latest member
slim313
Top