VBA, Loop filter distinct value, copy and paste to another designated workbook

Jacelyn Lok

New Member
Joined
Aug 17, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am new to VBA and I wish to complete task below in one Macro script. Will need you all help here.

1) Filter the Source file with Unique value tab
2) Copy the selected filtered column value and paste to the designated Destination file
3) Save the Destination file name as "Project Name" (this file is designated with only column name and blank content)
4) Continue loop for the next unique value and repeat from step 1) to 3).

I have tried a few code but it seems not working for my task.

Attached my sample "Source" and "Destination" workbook file.

Thanks.
 

Attachments

  • Destination.PNG
    Destination.PNG
    31.8 KB · Views: 13
  • Source.PNG
    Source.PNG
    35.2 KB · Views: 12

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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