Loop through range to create new files with dynamic subfolders
Solved/Closed
Mo_1001
Posts
3
Registration date
Thursday October 1, 2020
Status
Member
Last seen
October 12, 2020
-
Updated on Oct 15, 2020 at 11:45 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 22, 2020 at 11:57 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 22, 2020 at 11:57 AM
Related:
- Loop through range to create new files with dynamic subfolders
- Create skype account with gmail - Guide
- Snapchat create account with email - Guide
- Create new instagram account without phone number - Guide
- How to open msi files on android - Guide
- Create hotmail account - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 15, 2020 at 11:42 AM
Oct 15, 2020 at 11:42 AM
Hi Mo,
Some questions for you:
1) What do you mean by "personalized file"? Is that a new file with the "Formulaire" sheet copied into it?
2) Where are the subfolder names located on the "Info_base" sheet?
3) Where are the Groupnames located on the "Info_base" sheet?
Best regards,
Trowa
Some questions for you:
1) What do you mean by "personalized file"? Is that a new file with the "Formulaire" sheet copied into it?
2) Where are the subfolder names located on the "Info_base" sheet?
3) Where are the Groupnames located on the "Info_base" sheet?
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 22, 2020 at 11:57 AM
Oct 22, 2020 at 11:57 AM
Hi Mo,
Change the main path "C:\MyDocuments\", where your subfolders from column AC are located, on code line 13 and give the following code a try:
Change the main path "C:\MyDocuments\", where your subfolders from column AC are located, on code line 13 and give the following code a try:
Sub RunMe() Dim mCN, mGN, mSF As String Dim mWB As String mWB = ThisWorkbook.FullName Sheets("Info_base").Select For Each cell In Range("A3:A22") mCN = cell.Value mGN = Range("B" & cell.Row).Value mSF = Range("AC" & cell.Row).Value Sheets("Formulaire").Range("D22").Value = mCN ActiveWorkbook.SaveAs Filename:="C:\MyDocuments\" & mSF & "\" & "2021-01_Analysis_" & mGN & "_#" & mCN & ".xlsm" Next cell Workbooks.Open (mWB) Workbooks("2021-01_Analysis_" & mGN & "_#" & mCN & ".xlsm").Close End Sub
Oct 15, 2020 at 02:26 PM
1- It will include all the sheets from the "model" excel file, including '"Formulaire"
2- The subfolder names would be in the 29th column, that is column AC, with the contract numbers being in column A of the sheet "Info-base"
3- The groupnames are on column B, just right beside the contract numbers.
Thanks again