•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 391,974 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,145 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser:
Views: 1170 | Replies: 3 | Solved
![]() |
Hi All,
I am need of using a excel file as a standard template and then use a list of .csv files to populate certain rows and columns of this standard template and save it with a different name so that I can always reuse the standard template and it does not get altered..
Can anybody get me a solution. I prefer to use a VBA so as to have minimal effort to get the csv data and populate the excel.
Please help me.
I am need of using a excel file as a standard template and then use a list of .csv files to populate certain rows and columns of this standard template and save it with a different name so that I can always reuse the standard template and it does not get altered..
Can anybody get me a solution. I prefer to use a VBA so as to have minimal effort to get the csv data and populate the excel.
Please help me.
Regards
Shouvik
Shouvik
•
•
Join Date: May 2008
Location: San Diego, California
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 1
I do this manually with one of my files.
1) Back up your template!!!
2) Open the .csv file with Excel
3) Delete the columns you don't want and save the result with a temporary name as an .xls file.
4) Open the temporary .xls file, highlight the column or columns you want to copy, select "copy", open the template .xls file, highlight the columns to be replaced, and select "paste".
5) If the columns are not next to each other, you'll have to do this one column at a time.
6) Don't forget to make a backup before you start! It's easy to mess up with a manual process.
1) Back up your template!!!
2) Open the .csv file with Excel
3) Delete the columns you don't want and save the result with a temporary name as an .xls file.
4) Open the temporary .xls file, highlight the column or columns you want to copy, select "copy", open the template .xls file, highlight the columns to be replaced, and select "paste".
5) If the columns are not next to each other, you'll have to do this one column at a time.
6) Don't forget to make a backup before you start! It's easy to mess up with a manual process.
Hi All,
I could do this in the following manner
Master_Template is the original template
Model_Template is the new file.
I used a while loop by which I could create 1272 new Excel Workbooks with the Master_template format but data content varying. It took some 30 minutes to create and populate the new 1272 Workbooks.
I could do this in the following manner
VB Syntax (Toggle Plain Text)
Workbooks.Open Model_Template Workbooks(Master_Template).Activate Workbooks(Master_Template).Sheets("Master_Sheet").Select Workbooks(Master_Template).Sheets("Master_Sheet").Copy before:=Workbooks(Model_Template).Sheets("Sheet1") Workbooks(Model_Template).Sheets("Master_Sheet").Name = New_Name Workbooks(Model_Template).Save Workbooks(Model_Template).Close
Master_Template is the original template
Model_Template is the new file.
I used a while loop by which I could create 1272 new Excel Workbooks with the Master_template format but data content varying. It took some 30 minutes to create and populate the new 1272 Workbooks.
Regards
Shouvik
Shouvik
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Legacy and Other Languages Marketplace
Similar Threads
- opening an Excel file in VB.NET (VB.NET)
- how to link an excel program in vb.net? (VB.NET)
- vb6-excel problem (Visual Basic 4 / 5 / 6)
- problem in importing table into Excel (VB.NET)
- Open file from listbox (Visual Basic 4 / 5 / 6)
- Server exception when opening a excel file in VB.net (VB.NET)
- Open Excel in VB6 (Visual Basic 4 / 5 / 6)
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- Using Microsoft Excel 10.0 Libary Object -Dang .dlls (C#)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Pascal's Triangle
- Next Thread: MATLAB help please ?


Linear Mode