Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Auto Create WorkBooks from Master File

Hello guys,

On a weekly basis I create over 200 spreadsheets. Right now I have a code
in place where all I have to do is keep renaming a template by putting a
value in a specific cell, then the code places vlookups in each spreadhsheet
in the folder where the V Look ups feed off that one value. It saves me
hours if not days of work that way. But I still have to create each work
book individually and put in the unique value for each spreadsheet.

Is there away that I can just create a master file with all of the #'s in
column A, and a code and pick up say the value in A1, 1234, open up a
template, plug this 1234 in cell say F40, where the V Look ups would take
care of the rest, then save as the value in A1, then close and save, proceed
to A2 in the master file, on and on, until hits a blank in the master file
then ends the sub?

I'm I kidding myself or what?

Regards,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Auto Create WorkBooks from Master File

I put the value in F40 of the first worksheet in the template workbook.

Option Explicit
Sub testme()

Dim curWks As Worksheet
Dim newWks As Worksheet
Dim templateName As String
Dim myCell As Range
Dim myRng As Range

Set curWks = Worksheets("sheet1")
templateName = "C:\my documents\excel\book1.xls"

With curWks
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))

For Each myCell In myRng.Cells
Set newWks = Workbooks.Add(template:=templateName).Worksheets(1 )
newWks.Range("f40").Value = myCell.Value
Application.Calculate 'just in case
With newWks.Parent
'suppress the "already exists" prompt
Application.DisplayAlerts = False
.SaveAs Filename:=ActiveWorkbook.Path & "\" _
& myCell.Value & ".xls", _
FileFormat:=xlWorkbookNormal
Application.DisplayAlerts = True
.Close savechanges:=False
End With
Next myCell
End With

End Sub

JavyD wrote:

Hello guys,

On a weekly basis I create over 200 spreadsheets. Right now I have a code
in place where all I have to do is keep renaming a template by putting a
value in a specific cell, then the code places vlookups in each spreadhsheet
in the folder where the V Look ups feed off that one value. It saves me
hours if not days of work that way. But I still have to create each work
book individually and put in the unique value for each spreadsheet.

Is there away that I can just create a master file with all of the #'s in
column A, and a code and pick up say the value in A1, 1234, open up a
template, plug this 1234 in cell say F40, where the V Look ups would take
care of the rest, then save as the value in A1, then close and save, proceed
to A2 in the master file, on and on, until hits a blank in the master file
then ends the sub?

I'm I kidding myself or what?

Regards,


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining data from 6 workbooks into one master natty2506 Excel Discussion (Misc queries) 1 February 3rd 10 03:52 PM
Auto Create an Excel Backup File on a Daily Basis igbert Excel Discussion (Misc queries) 1 October 2nd 09 09:16 PM
how to create a list and link it to the master excel file taj Excel Worksheet Functions 0 April 20th 07 07:26 PM
How can I create a master spreadsheet from different workbooks Dawn Williams Excel Discussion (Misc queries) 1 May 3rd 06 12:10 PM
auto create a file -Brian-H- Excel Discussion (Misc queries) 0 October 12th 05 12:24 AM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"