Create New Workbook in a New Folder VBA CODE

fari1

Active Member
Joined
May 29, 2011
Messages
362
I want a vba code that copies data from sheet1 workbook1 range A1:C30 and paste it into a new workbook after creating a new folder, the name of the workbook will be taken from the cell A1 from sheet2 from workbook1, and the name of the folder from the cell2 sheet2 workbook1. I also want the code to check if the folder already exists for that partiular name in cell A2, if it does then simply create a new workbook into that folder else create a new folder by that name and then create workbook into it.
hope i made my point clear.

Also this part of the code is a part of web query, the data is brought in with web query and then workbook and folders are get created, so please provide the code that works as a loop.

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,224,585
Messages
6,179,702
Members
452,938
Latest member
babeneker

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