VBA Create Folder and new workbook

Status
Not open for further replies.

Prince27

New Member
Joined
Nov 24, 2012
Messages
41
I have 2 workbooks.

1 is "Raw Data" and another one "Mail Info"

I'm looking for a VB code with the below requirements:

1. In "Mail Info" workbook, columns A (A2: A20) has a list of names and Cell "C7" has drop down list with reference to "A2:A20"

2. If Cell “C7” says value as “Chandoo”, then data in “Raw Data” workbook should filter by “Chandoo” (can be found in column name “Email”) and create a new folder called “Chandoo” and save the file as “Chandoo + current date + current time).xlsx in a specific path. (“C:\\Desktop\Files\Chandoo\Chandoo_8/18/2020_2:23 PM.xlsx). If folder already exists only the excel workbook should get saved

3. If Cell “C7” says “ALL”, then data in “Raw Data” workbook should filter by all the names given in column A (A2:A20). The above step should be repeated for each unique name.

***The below point is not mandate, would be helpful if can be done.***

4. If column A (A2:A20) has names like ‘Chandoo’, ‘Mahesh’, ‘John’ etc., however “Raw data” has unique names like ‘Chandoo’, ‘Mahesh’, ‘John’, ‘Bob’, which is missing in the list, then folder and file creation should be done for ‘Bob’ as well and the name to be added to column A (A2:A20)



Note: Here, I’m trying to split the raw data file into each individual files and save in the respective folders.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Status
Not open for further replies.

Forum statistics

Threads
1,214,430
Messages
6,119,438
Members
448,897
Latest member
dukenia71

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