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
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]File[/TD]
[TD]Task[/TD]
[TD]Due Date[/TD]
[TD]Priority[/TD]
[TD]![/TD]
[TD]Status[/TD]
[TD]Notes[/TD]
[/TR]
[TR]
[TD]Example File[/TD]
[TD]Example task to be completed[/TD]
[TD]2019-11-03[/TD]
[TD]Medium[/TD]
[TD]5[/TD]
[TD]Pending[/TD]
[TD]"Intentionally left blank"<intentionally left="" blank=""></intentionally>[/TD]
[/TR]
[TR]
[TD]2nd File[/TD]
[TD]Example Completed task[/TD]
[TD]2019-11-02[/TD]
[TD]High[/TD]
[TD]11[/TD]
[TD]Complete[/TD]
[TD]Task completed with no issues[/TD]
[/TR]
</tbody>[/TABLE]

  • 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 :)
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hello,

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

Have you tried AutoFilter ?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top