VBA to copy multiple filtered data to another sheet from the last occupied cell

SteynBS

Board Regular
Joined
Jun 27, 2022
Messages
102
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I have a table with multiple columns, the number of columns will always change as the data changes. I need to filter each column and copy the corresponding data to another sheet. Go back to the table filter another column and copy that corresponding data to the other sheet. This process continues for all the available columns with data. Examples below. The table on the right needs to be filter per column with data. The corresponidng data is found in the table on the left.
1668158841710.png

Example 1
1668158908971.png

Example 2 and so on
1668158940032.png

What ever is visible on the table on the left needs to be copied into another sheet named "delete" from cell B2. When the 2nd column is filtered, the data in the left table should be copied in the Sheet "delete" below the previous data that was coppied.

In example 1 Column G was filtered. With the corresponding data in the left table I need the header to be copied and pasted as well(headers value will change from time to time). So the Header is pasted in Column A with the data from the left table pasted from Column C through D

This should be done for all the columns availabe on the right which will either be more or less columns depending on the data.

I will appreciate any guidance and assistance.

1668159159810.png
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,617
Messages
6,120,541
Members
448,970
Latest member
kennimack

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