Any help is appreciated Creating New files from One File

  • Thread starter Thread starter JackSmiley
  • Start date Start date
J

JackSmiley

I have a file that i have added a control that allows the user to
change criteria and recalculate the worksheet. I have developed the
code that loops through all the scenarios I enter and prints each one.

What I really want to do is loop through these scenarios and then
instead of printing, create a new separate file, then keep moving
through the loop and creating new files

Thanks in advance
 
try this

from
for RowCount = 1 to 10
Rows(RowCount).Printout
next RowCount

to
set Oldsht = activeworkbook.activesheet
for RowCount = 1 to 10
set newbk = Workbooks.add
Oldsht.Rows(RowCount).Copy _
Destination:=newbk.Rows(1)
newbk.saveas filename:="abc"&RowCount&".xls"
activeworkbook.close
next RowCount
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top