# Move 'completed' information from one table to another table.



## Ev1lZer0 (Dec 22, 2022)

Without using a macro, I am wanting to completely move, not filter, information from table 2 located on the sheet called '2022 trial calendar' to a NEW table with the exact same headers if column w on table 2 has one of 10 words in it. This new table (table 5) would be on a new sheet (sheet1).

the 10 words are:
Plea
Dismissed W/O Prej
Dismissed W/Prej
Jury
Bench
Mistrial
Plea/Sentence
Sentencing
Civil Commitment
FTA

These words are located on the 'data validation' sheet and listed in cells b2-b11 if this helps shorten a formula.

Is this possible?

If so how? I can upload the document if I must, but I'd prefer if I don't have to.


----------



## HongRu (Dec 22, 2022)

Try to use power query.
Copy the code below into Power Query.
Note:
1. your data table must be named "table2".
2. your column w title must be named "Column w".
3. Or you can amend the code below by replacing "table2", "Column w" with what you exactly have.
4. Since the result is a Table, you should refresh manually the Table while you update your "table2".

Step1. selection the table 2, press Alt A P T in sequence to use PQ.
Step2. press Alt H Q in sequence to edit the M code.
Step3. replace all the code with my code below.
Step4. close the PQ.
Done.


```
let
    Source = Excel.CurrentWorkbook(){[Name="table2"]}[Content],
    SelectRows = Table.SelectRows(Source , each ([Column w] = "Bench" or [Column w] = "Civil Commitment" or [Column w] = "Dismissed W/O Prej" or [Column w] = "Dismissed W/Prej" or [Column w] = "FTA" or [Column w] = "Jury" or [Column w] = "Mistrial" or [Column w] = "Plea" or [Column w] = "Plea/Sentence" or [Column w] = "Sentencing"))
in
    SelectRows
```


----------



## Ev1lZer0 (Dec 23, 2022)

Okay, this works. And I understand how to re-run the query by going to data and clicking "refresh all."

But now, is there a way to, once the data has moved to the new table, remove the data from the original table?


----------



## HongRu (Dec 23, 2022)

Ev1lZer0 said:


> Okay, this works. And I understand how to re-run the query by going to data and clicking "refresh all."
> 
> But now, is there a way to, once the data has moved to the new table, remove the data from the original table?


I don't know is there any way?
Maybe you can only do it manually.


----------

