Save excel file as specified titles in different workbook
Closed
Anna
-
Jun 6, 2019 at 05:57 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 11, 2019 at 11:36 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 11, 2019 at 11:36 AM
Related:
- Save excel file as specified titles in different workbook
- Save as pdf office 2007 - Download - Other
- Windows 10 iso file download 64-bit - Download - Windows
- Kmspico zip file download - Download - Other
- Number to words in excel - Guide
- Tiny 11 iso file download - Download - Windows
3 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Jun 6, 2019 at 12:16 PM
Jun 6, 2019 at 12:16 PM
Hi Anna,
It seems I didn't know how to post codes back then :). I always like to recap the question so there is no confusion as to what the code does.
So you have a Master workbook, which has workbook names in column A with a header. Now you want to copy the Master workbook and rename it according to the names mentioned in column A. The copied and renamed workbooks should not contain the code.
For that give the following code a try, but only after replacing the file path:
Best regards,
Trowa
It seems I didn't know how to post codes back then :). I always like to recap the question so there is no confusion as to what the code does.
So you have a Master workbook, which has workbook names in column A with a header. Now you want to copy the Master workbook and rename it according to the names mentioned in column A. The copied and renamed workbooks should not contain the code.
For that give the following code a try, but only after replacing the file path:
Sub RunMe() Dim x As Integer Application.DisplayAlerts = False x = 2 Do ActiveWorkbook.SaveAs Filename:="C:\Documents\" & Range("A" & x).Value & ".xlsx", FileFormat:=xlOpenXMLWorkbook x = x + 1 Loop Until Range("A" & x).Value = vbNullString ActiveWorkbook.Close Application.DisplayAlerts = True End Sub
Best regards,
Trowa
Hi Trowa,
Thank you for your fast response, I appreciate it a lot.
However, I just want to make one correction to the scenario - my master file that has names in column A and macros is in one file, but the copy the macros should be is of another file. So the macros should tell: take the names that are in the home file column A, and go to this file ( separate file - that is just a simple form/ template) > make as many copies of that file as the names are here and title them by names.
That is the task, and you did most part of that. THANK YOU!!!
Will be looking forward to hear from you!
Anna
Thank you for your fast response, I appreciate it a lot.
However, I just want to make one correction to the scenario - my master file that has names in column A and macros is in one file, but the copy the macros should be is of another file. So the macros should tell: take the names that are in the home file column A, and go to this file ( separate file - that is just a simple form/ template) > make as many copies of that file as the names are here and title them by names.
That is the task, and you did most part of that. THANK YOU!!!
Will be looking forward to hear from you!
Anna
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Jun 11, 2019 at 11:36 AM
Jun 11, 2019 at 11:36 AM
Hi Anna,
My bad, I missed the separate template file part.
Here you go:
Best regards,
Trowa
My bad, I missed the separate template file part.
Here you go:
Sub RunMe() Dim x As Integer, wbName As String x = 2 Do wbName = Range("A" & x).Value Workbooks.Open Filename:="C:\Documents\Template File.xlsx" With ActiveWorkbook .SaveAs Filename:="C:\Documents\" & wbName & ".xlsx" .Close End With x = x + 1 Loop Until Range("A" & x).Value = vbNullString End Sub
Best regards,
Trowa