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

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

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