Macro for creating separate password protected files based on column value

pamla143

New Member
Joined
Jul 5, 2017
Messages
1
Hi All,
I need urgent help for a macro which will create separate files from a column value
I have this data in the table attached

Sales Report
Current Date6/26/2017
As at Date6/23/2017
CategoryInternational
Salesperson
Order ID

<tbody>
</tbody><colgroup><col></colgroup>
Units

<tbody>
</tbody><colgroup><col></colgroup>
Order Amount

<tbody>
</tbody><colgroup><col></colgroup>
Country

<tbody>
</tbody><colgroup><col></colgroup>
Days Remaining

<tbody>
</tbody><colgroup><col></colgroup>
Richard

<tbody>
</tbody><colgroup><col></colgroup>
10392

<tbody>
</tbody><colgroup><col></colgroup>
13

<tbody>
</tbody><colgroup><col></colgroup>
144.00

<tbody>
</tbody><colgroup><col></colgroup>
USA

<tbody>
</tbody><colgroup><col></colgroup>
5
Mary

<tbody>
</tbody><colgroup><col></colgroup>
10397

<tbody>
</tbody><colgroup><col></colgroup>
17

<tbody>
</tbody><colgroup><col></colgroup>
716.00

<tbody>
</tbody><colgroup><col></colgroup>
MEX6
Ben

<tbody>
</tbody><colgroup><col></colgroup>
10771

<tbody>
</tbody><colgroup><col></colgroup>
18

<tbody>
</tbody><colgroup><col></colgroup>
344.00

<tbody>
</tbody><colgroup><col></colgroup>
CAN7
Kenneth

<tbody>
</tbody><colgroup><col></colgroup>
10393

<tbody>
</tbody><colgroup><col></colgroup>
20

<tbody>
</tbody><colgroup><col></colgroup>
2556.00

<tbody>
</tbody><colgroup><col></colgroup>
MEX8
Richard

<tbody>
</tbody><colgroup><col></colgroup>
10394

<tbody>
</tbody><colgroup><col></colgroup>
9

<tbody>
</tbody><colgroup><col></colgroup>
2122.00

<tbody>
</tbody><colgroup><col></colgroup>
CAN9
Fuller

<tbody>
</tbody><colgroup><col></colgroup>
10395

<tbody>
</tbody><colgroup><col></colgroup>
7
1903.00

<tbody>
</tbody><colgroup><col></colgroup>
USA10
Peter

<tbody>
</tbody><colgroup><col></colgroup>
1039617
1591.00

<tbody>
</tbody><colgroup><col></colgroup>
BRA11

<tbody>
</tbody>

Now the data is already segregated to four sheets named "5 to 6 days", "7 to 8 days", "9 to 10 days" and "11 days and above" as per the Column F (Days Remaining).

The macro should create separate files as per the Country (Column E) for each of the day sheets separately. For example, at first it will go to the sheet named "5 to 6 days" to perform the below operation and then it will repeat the same process for the remaining 3 sheets.
Note: *The files should be saved in 4 different folders named as "5 to 6 days", "7 to 8 days", "9 to 10 days" and "11 days and above" in the location where the master file exists.
*The first four rows should be same for all the files.
*The file's name should be the Country code_Cash, for e.g. "USA_Cash"
*The pasword should be "abcd" for all the files.
*I am using Office 2013 version

Please get back for any details/clarifications.

Thanks in advance for your help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,480
Messages
6,125,047
Members
449,206
Latest member
Healthydogs

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