Close Window   
Free Ebook
Got an Excel Question?
Ask it in our Excel forum!
TeachExcel.com
Subscribe for Free Excel tips & more!
E-mail:
Advertisements



How Do I Save Sheets In A Workbook To Separate Files?

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

I have a wokbook with MANY sheets. I was wondering if there was a quick way
to save the sheets into separate files (perhaps using tab names) whilst
retaining each ones header and footer.


View Answers     

Similar Excel Tutorials

Change the Default Number of Worksheets Created in a New Excel Workbook
Learn how to change the number of worksheets that are in new Excel workbooks. Excel workbooks always have 3 worksh ...
Export an Excel File to a CSV File
How to export an Excel file to a CSV file (comma separated values file).  This allows you to turn any Excel spread ...
Close Excel Workbook using VBA Macros
How to close an Excel workbook using VBA and macros, including how to save the file before you close it or discard ...
Macro to get Data from Another Workbook in Excel
Macro to get data from a workbook, closed or open, over a network or locally on your computer. This is a versatile ...

Helpful Excel Macros

Delete All Chart Sheets in Excel - Only Chart Sheets are Deleted - Not Embedded Charts
- Delete all chart sheets and tabs in Excel using this macro. This will only delete the charts and graphs that are in the
Name Worksheets Based on Cell Contents
- This macro allows you to have your worksheets named by whatever is in a particular cell within a worksheet. This means
Excel Macro that Searches Entire Workbook and Returns All Matches
- This is the ultimate Lookup Macro for Excel. It will search every worksheet in the workbook and return all of the mat
Save the Current Worksheet as a New Excel Workbook File
- This Excel Macro will save the currently visible/active worksheet (the one that you see when you run the macro) to a
Excel Macro to Save a Specific Worksheet as a New File
- This Excel Macro allows you to save a specific worksheet within the Excel Workbook to its own new file. You will be a

Similar Topics







Hi,

I have a workbook with 45 sheets and I am looking for a script to save all sheets as separate text files. The script should take the "save as" file names from the sheet names.

Although they should be saved as text files, the extension is php as given in the sheet names.

Unfortunately I've been out of practice for years with Excel VBA macros of this deepth, so I would highly appreciate some help for the above!

Thanks a lot, Minnesaenger


I have a CSV that I need to break up into separate files based on the values in column "G"

My end goal is to break up the data like this:

value A.csv
value B.csv
...
...
value n.csv

So all rows with "value A" in column "G" will be saved into value A.csv and so on.

I currently have a macro that will save all open sheets to .csv files.

A macro to break out the data into separate sheets or one that just directly saves the data to csv files would be very helpful.

Any suggestions?

Here is my macro that saves all sheets to .csv files:

Code:

Option Explicit
Sub mysaver()
Dim counter As Integer
counter = 1
' counter is for the number of sheets in the workbook
Do While counter

I have a spreadsheet with 10 sheets. I need to set up some VBA code so the macro will save three of the tabs as separate .csv files for uploading into our software.

The three tabs are named: EID Upload, Wages with Locals Upload, Wages without Local Upload.

Right now, I would like the new file names to match the sheet names.

Thanks,

Jason




Hello, Can anyone help me with these, please?from the attached file I need to perform 2 actions.

1. save individual files with cost code name.
2. new created files should have a individual sheets by expense code and all data should be there.

For example after performing macro from a large amount of data I should end up with file called : Rosewood/Sandalwwod Sq that contains 3 separate sheets such as Service charges, Voids available and Management fees retirement with all data.

Cheers,

Mish

Hi! I have a workbook that had several worksheets in it. Someone else
wanted these sheets as separate .xls files (workbooks). I think it is
easier to have one workbook...simpler for me to update. the problem is the
users only care about individual sheets and want those in separate .xls
files so they only see their pertinent info.

In other words, i have myMasterList.xls which contains Sheet1 through
SheetN. I'm also maintaining separate workbooks called Sheet1.xls,
Sheet2.xls......SheetN.xls.

is there an easy way for me to maintain one workbook, or separate worksheets
that are updated through my myMasterList.xls?

Summary...the problem is I'm updating the stuff twice--once in
myMasterList.xls and again in the Sheet#.xls files.

Any help would be greatly appreciated. Thanks.

Marcia





Hello -

I export a excel file (master) from a website and that excel file has at least 25 sheets. My client has asked me to provide 25 separate workbooks instead of one WB with 25 sheets in it. I can do manually but to do this in a daily basis can be time consuming for me and therefore I am requesting your help. Is there a solution so that when I run it (template) it will break the master file into separate files? Also, If I can save those individual files in a specific folder that will be great as well. Please suggest as what is possible. Thank you for your help!!


I have a sheet where column A has the names of different managers I need to distribute data to.

I would like a macro to filter by manager name, create a separate sheet with all the data on it, format it the same way and save the sheets in separate files.

Not only would I like the text to be formatted the same way, I would like the sheet itself to have the same page layout.

Anyone have one handy?


I need a macro to copy all sheets in a workbook , Each sheet to one separate workbook.

But I want this workbook to have the header and footer of my old workbook too.


Hello everyone,

Here is what I'm trying to do:
I want to open all the .csv files in a directory, but rather than open them in separate workbooks, I'd like to open each of them in a separate sheet in the same workbook. I should mention that the number of files that will be in the directory will vary from week to week.
What I would then have to do is scan through each worksheet and delete a number of specific rows. Once that is done, I will have to copy the remaining data into the main sheet so I can count the number of unique rows.

Here's some code I came across that will open all files in a directory, but it opens each one in a separate workbook.

Code:

Dim i As Integer, wb As Workbook
With Application.FileSearch
.NewSearch
.LookIn = "H:\My Documents\Spreadsheets\KB Page Access Report Generator\Test Data"
.SearchSubFolders = False
.Filename = "*.csv"
.Execute
For i = 1 To .FoundFiles.Count
'Open each workbook
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
 
'I don't need the code below so I've just commented it out for now.
 
'Perform the operation on the open workbook
'wb.Worksheets("sheet1").Range("A1") = Date
'Save and close the workbook
'wb.Save
'wb.Close
'On to the next workbook
Next i
End With





Hello,

I have a workbook with dozens of sheets. I would like to save each sheet as a separate csv file, with each file taking the name of the worksheet. Is there an easy way to do this? I don't really know VBA.

Thanks.


I have a workbook that consists of 2 worksheets, after the data is entered
the 2 sheets are separate and saved into a folder with the the 2 sheets as
individual files. This all works fine if I specify the saving location, what
I would like to know is how to automatically save the the new folder and
files into the root directory of the device the original workbook was
started. The workbook runs on several portable usb devices so the starting
location can vary from device to device. The name of the parent folder that
the new folders and files are saved to is constant. ie: ??:\Sheets\??????.
Thank you



Hi guys

I have about 300 graphs that I want to save as picture files and was wondering if there was a quick way of doing it - They are in 32 sheets which each having about 10 graphs per sheet - is there an add in that I could download.

The thought of copy and paste into paint and then saving as is not something that I want to contemplate just now!

Cheers


Aidan


I am having trouble figuring out a way to take 2 separate files with 1 sheet each to be combined into a master file with 2 sheets. Ideally the files would be in separate folders but they could be put in the same file if it would be easier.

I have very basic VBA knowledge/experience and its giving me a headache! Any help would be appreciated!


I have a workbook with mutliple sheets in it. Is there a simple way to save each sheet as a separate file.

THANKS!


Hi All,
In my everyday work, I need to check the header and footer of every worksheet in an excel workbook and then edit them. In case of big workbooks having many worksheets, this becomes a tedious process. Does someone know of a macro that can do either of the following:
1. Print all the header and footer from all the worksheets in a workbook as a textfile (log file).
OR
2. Detect the sheets that have the header and footer and ignore the rest so that I can run a macro on these selected sheets to delete the header and footer (I already know of one such macro).

Thanks in advance,
Lonely


Hello everyone,

I want to run a macro for a text to columns in all the sheets I have in my workbook. The number of sheets I'm using can go up to 60. The below code I found on the internet is only doing the work for the first sheet. It does display the other sheets' names but doesn't perform the text to columns command.

After I have all the sheets as I want them, I eventually would like to save each sheet as a separate excel file.

Is any of you able to help me on that? I.e. first get my macro to work in each sheet and then save the sheets as individual excel files.


VB:

 
 
 
Sub WorksheetLoop() 
     
    Dim WS_Count As Integer 
    Dim I As Integer 
     
     
    WS_Count = ActiveWorkbook.Worksheets.Count 
     
     
    For I = 1 To WS_Count 
        Selection.TextToColumns _ 
        Destination:=Range("A1"), _ 
        DataType:=xlDelimited, _ 
        TextQualifier:=xlDoubleQuote, _ 
        ConsecutiveDelimiter:=False, _ 
        Tab:=False, _ 
        Semicolon:=True, _ 
        Comma:=False, _ 
        Space:=False, _ 
        Other:=False, _ 
        OtherChar:="-" 
         
        MsgBox ActiveWorkbook.Worksheets(I).Name 
         
    Next I 
     
End Sub 


If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines




Hi,



So - I need to save 2 of the sheets within my workbook as CSVs



Sheet3.SaveAs "C:\Temp2.csv", xlCSV



is ok - but it changes the sheets name within my workbook, aas well as the main worknook name. SDO next time I run the macro, it can't access sheet2 or 3.



How can I get it sio that I get my 2 csv files, and no changes to the naming witin the workbook?


I have a workbook that has 100 sheets. I want to save each sheet as a
separate xls file. Even though I could save each by copying into new
worksheet and save manually, I am looking for a way to automate it by using
script. Can anyone help?



This site has got me hooked on using VB ... Thank you!! Usually I can find my answers in the archieves, but today I am having trouble. Hopefully someone can help with this problem.
I have a workbook that is used by several people. To maintain its size I use command buttons to save completed sheets and save them to a folder as individual files. These Sheets are orders we run throughout the day, each are renamed automatically by a cell value. I use a command button to add more sheets as more orders come in. Sheets are created by a hidden sheet and named accordingly.
I simply want to move these sheets to the end via VB ... Please Help
(As you view the code you can see that all the new sheets are selected together. All I have to do is send them to the end, but inevitably someone will mess the whole thing up!!!)

Sub ADD4()

On Error GoTo AddSheetsFinalize
Sheets("Sheet (A)").Visible = True
Sheets("Sheet (A)").Select
Sheets("Sheet (A)").Copy Befo =Sheets(1)
Sheets("Sheet (A) (2)").Select
Sheets("Sheet (A) (2)").Name = "Sheet (1)"
Sheets("Sheet (A)").Select
Sheets("Sheet (A)").Copy Befo =Sheets(2)
Sheets("Sheet (A) (2)").Select
Sheets("Sheet (A) (2)").Name = "Sheet (2)"
Sheets("Sheet (A)").Select
Sheets("Sheet (A)").Copy Befo =Sheets(3)
Sheets("Sheet (A) (2)").Select
Sheets("Sheet (A) (2)").Name = "Sheet (3)"
Sheets("Sheet (A)").Select
Sheets("Sheet (A)").Copy Befo =Sheets(4)
Sheets("Sheet (A) (2)").Select
Sheets("Sheet (A) (2)").Name = "Sheet (4)"

AddSheetsFinalize:
Sheets("Sheet (A)").Visible = False

Sheets(Array("Sheet (1)", "Sheet (2)", "Sheet (3)", "Sheet (4)")).Select
Sheets("Sheet (1)").Activate

Somewhere here I need the code to send these 4 sheets to the end of the workbook!

ActiveWorkbook.Save

End Sub

CalB


Hi

Can u help any body in merging the multiple *.xls files into one single *.xls file but each *.xls file com in separate worksheet.

Say i have 30 xls files in datewise i.e., 01.10.10, 02.10.10, 03.10.10 so on....

I want to merge all the above 30 xls files in single file master workbook - in that master workbook file the above 30 xls should come in separate work sheets.

Thank you

I have a big workbook. Since it takes so long to save a workbook when I only change 1-2 cells. If I split it up and link say, my input page (book1) to a huge database (book2), will have any errors later. I do have to forward this to several people now as a zip file. But if I separate and link to each other, I can send as individual files which they would like, but since they store them on their own pc....what would be any issues????

I guess my biggest fear is loosing the link from book to book2 during this process?


I have a workbook that I have split into separate worksheets using the Pivot Table, Show Pages command - I would like to split these sheets and save to individual new files (automatically of course!) - any help much appreciated to save me masses of time every time I have to do this!!


Hi,

i'm trying to loop through a folder of csv files, import them each into a separate workbook, and save as xls files into a different folder using the contents of a particular cell as the name of the xls.

i've found code for loops, but i don't have the expertise to customize for cvs files. and the save-as has been giving me fits.

any help would be appreciated!


I am trying to print 5 active sheets to a single PDF document. I have 7 sheets in the workbook, and I am only selecting 5 to print.

When I try this with either Acrobat PDF Writer or Acrobat Distiller, I end up with two sheets in one PDF file, and three separate PDF files with the other sheets. I am using Acrobat 4.0. I have had similar problems with other Excel workbooks.

Anyone know how to to get the print to PDF to put all the active sheets into one file without doing it manually?


I have a macro that pulls information from other excel files in the same directory. The problem arises when the macro encounters a corrupt file, which causes it to automatically shut down the macro and not save any of the previously pulled information.

Is there a function or command that will cause the macro to skip over corrupted files? I tried playing around with the CorruptFile command but that didn't seem to be going in the right direction.

The macro is as listed below. Thanks in advance for any help.

Code:

 Sub Data_Extractor()
Application.ScreenUpdating = False
'ThisWorkbook.Sheets(1).Cells.Clear 'or change this to be the MASTER SPREADSHEET
n = 1
On Error Resume Next
With Application.FileSearch
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
.SearchSubFolders = True
.Execute
For i = 1 To (.FoundFiles.Count - 1)
'If Workbooks(.FoundFiles(i)).Name = ThisWorkbook.Name Then GoTo NotMe
Workbooks.Open .FoundFiles(i), UpdateLinks:=False
n = n + 1
ThisWorkbook.sheets(1).Cells(n, 125).Value = .FoundFiles(i)
If ActiveSheet.Name = "WORK(OPT #1)" Then 
 Else 
 With sheets("WORK(OPT #1)")
ThisWorkbook.sheets(1).Cells(n, 1).Value = .Range("B2").Value
ThisWorkbook.sheets(1).Cells(n, 2).Value = .Range("B3").Value
ThisWorkbook.sheets(1).Cells(n, 3).Value = .Range("D37").Value
ThisWorkbook.sheets(1).Cells(n, 4).Value = .Range("B4").Value
ThisWorkbook.sheets(1).Cells(n, 5).Value = .Range("B5").Value
ThisWorkbook.sheets(1).Cells(n, 6).Value = .Range("I50").Value
ThisWorkbook.sheets(1).Cells(n, 7).Value = .Range("E3").Value
ThisWorkbook.sheets(1).Cells(n, 8).Value = .Range("E2").Value
ThisWorkbook.sheets(1).Cells(n, 9).Value = .Range("B8").Value
ThisWorkbook.sheets(1).Cells(n, 10).Value = .Range("G8").Value
ThisWorkbook.sheets(1).Cells(n, 11).Value = .Range("E12").Value
ThisWorkbook.sheets(1).Cells(n, 12).Value = .Range("E9").Value
ThisWorkbook.sheets(1).Cells(n, 13).Value = .Range("E10").Value
ThisWorkbook.sheets(1).Cells(n, 14).Value = .Range("E33").Value
ThisWorkbook.sheets(1).Cells(n, 15).Value = .Range("E30").Value
ThisWorkbook.sheets(1).Cells(n, 16).Value = .Range("E31").Value
ThisWorkbook.sheets(1).Cells(n, 17).Value = .Range("E19").Value
ThisWorkbook.sheets(1).Cells(n, 18).Value = .Range("E24").Value
ThisWorkbook.sheets(1).Cells(n, 19).Value = .Range("H8").Value
ThisWorkbook.sheets(1).Cells(n, 20).Value = .Range("B51").Value
ThisWorkbook.sheets(1).Cells(n, 21).Value = .Range("B52").Value
ThisWorkbook.sheets(1).Cells(n, 22).Value = .Range("B53").Value
ThisWorkbook.sheets(1).Cells(n, 23).Value = .Range("B54").Value
ThisWorkbook.sheets(1).Cells(n, 24).Value = .Range("D8").Value
ThisWorkbook.sheets(1).Cells(n, 25).Value = .Range("D9").Value
ThisWorkbook.sheets(1).Cells(n, 26).Value = .Range("D10").Value
ThisWorkbook.sheets(1).Cells(n, 27).Value = .Range("D29").Value
ThisWorkbook.sheets(1).Cells(n, 28).Value = .Range("D30").Value
ThisWorkbook.sheets(1).Cells(n, 29).Value = .Range("D31").Value
ThisWorkbook.sheets(1).Cells(n, 30).Value = .Range("E15").Value
ThisWorkbook.sheets(1).Cells(n, 31).Value = .Range("D24").Value
ThisWorkbook.sheets(1).Cells(n, 32).Value = .Range("E50").Value
ThisWorkbook.sheets(1).Cells(n, 33).Value = .Range("E51").Value
ThisWorkbook.sheets(1).Cells(n, 34).Value = .Range("E52").Value
ThisWorkbook.sheets(1).Cells(n, 35).Value = .Range("E53").Value
ThisWorkbook.sheets(1).Cells(n, 36).Value = .Range("E54").Value
ThisWorkbook.sheets(1).Cells(n, 37).Value = .Range("F50").Value
ThisWorkbook.sheets(1).Cells(n, 38).Value = .Range("F51").Value
ThisWorkbook.sheets(1).Cells(n, 39).Value = .Range("F52").Value
ThisWorkbook.sheets(1).Cells(n, 40).Value = .Range("F53").Value
ThisWorkbook.sheets(1).Cells(n, 41).Value = .Range("F54").Value
ThisWorkbook.sheets(1).Cells(n, 42).Value = .Range("G50").Value
ThisWorkbook.sheets(1).Cells(n, 43).Value = .Range("G51").Value
ThisWorkbook.sheets(1).Cells(n, 44).Value = .Range("G52").Value
ThisWorkbook.sheets(1).Cells(n, 45).Value = .Range("G53").Value
ThisWorkbook.sheets(1).Cells(n, 46).Value = .Range("G54").Value
ThisWorkbook.sheets(1).Cells(n, 47).Value = .Range("H50").Value
ThisWorkbook.sheets(1).Cells(n, 48).Value = .Range("H51").Value
ThisWorkbook.sheets(1).Cells(n, 49).Value = .Range("H52").Value
ThisWorkbook.sheets(1).Cells(n, 50).Value = .Range("H53").Value
ThisWorkbook.sheets(1).Cells(n, 51).Value = .Range("H54").Value
ThisWorkbook.sheets(1).Cells(n, 52).Value = .Range("A62").Value
ThisWorkbook.sheets(1).Cells(n, 53).Value = .Range("A63").Value
ThisWorkbook.sheets(1).Cells(n, 54).Value = .Range("A64").Value
ThisWorkbook.sheets(1).Cells(n, 55).Value = .Range("B62").Value
ThisWorkbook.sheets(1).Cells(n, 56).Value = .Range("B63").Value
ThisWorkbook.sheets(1).Cells(n, 57).Value = .Range("B64").Value
ThisWorkbook.sheets(1).Cells(n, 58).Value = .Range("D62").Value
ThisWorkbook.sheets(1).Cells(n, 59).Value = .Range("D63").Value
ThisWorkbook.sheets(1).Cells(n, 60).Value = .Range("D64").Value
ThisWorkbook.sheets(1).Cells(n, 61).Value = .Range("E62").Value
ThisWorkbook.sheets(1).Cells(n, 62).Value = .Range("E63").Value
ThisWorkbook.sheets(1).Cells(n, 63).Value = .Range("E64").Value
ThisWorkbook.sheets(1).Cells(n, 64).Value = .Range("F62").Value
ThisWorkbook.sheets(1).Cells(n, 65).Value = .Range("F63").Value
ThisWorkbook.sheets(1).Cells(n, 66).Value = .Range("F64").Value
ThisWorkbook.sheets(1).Cells(n, 67).Value = .Range("G62").Value
ThisWorkbook.sheets(1).Cells(n, 68).Value = .Range("G63").Value
ThisWorkbook.sheets(1).Cells(n, 69).Value = .Range("G64").Value
ThisWorkbook.sheets(1).Cells(n, 70).Value = .Range("H62").Value
ThisWorkbook.sheets(1).Cells(n, 71).Value = .Range("H63").Value
ThisWorkbook.sheets(1).Cells(n, 72).Value = .Range("H64").Value
ThisWorkbook.sheets(1).Cells(n, 73).Value = .Range("D41").Value
ThisWorkbook.sheets(1).Cells(n, 74).Value = .Range("D42").Value
ThisWorkbook.sheets(1).Cells(n, 75).Value = .Range("D43").Value
ThisWorkbook.sheets(1).Cells(n, 76).Value = .Range("D44").Value
ThisWorkbook.sheets(1).Cells(n, 77).Value = .Range("I44").Value
ThisWorkbook.sheets(1).Cells(n, 78).Value = .Range("I45").Value
ThisWorkbook.sheets(1).Cells(n, 79).Value = .Range("I40").Value
ThisWorkbook.sheets(1).Cells(n, 80).Value = .Range("I43").Value
ThisWorkbook.sheets(1).Cells(n, 81).Value = .Range("L35").Value
ThisWorkbook.sheets(1).Cells(n, 82).Value = .Range("U35").Value
ThisWorkbook.sheets(1).Cells(n, 83).Value = .Range("K12").Value
ThisWorkbook.sheets(1).Cells(n, 84).Value = .Range("I41").Value
ThisWorkbook.sheets(1).Cells(n, 85).Value = .Range("I42").Value
ThisWorkbook.sheets(1).Cells(n, 86).Value = .Range("D46").Value
ThisWorkbook.sheets(1).Cells(n, 87).Value = .Range("A50").Value
ThisWorkbook.sheets(1).Cells(n, 88).Value = .Range("A51").Value
ThisWorkbook.sheets(1).Cells(n, 89).Value = .Range("A52").Value
ThisWorkbook.sheets(1).Cells(n, 90).Value = .Range("A53").Value
ThisWorkbook.sheets(1).Cells(n, 91).Value = .Range("A54").Value
ThisWorkbook.sheets(1).Cells(n, 92).Value = .Range("I8").Value
ThisWorkbook.sheets(1).Cells(n, 93).Value = .Range("I9").Value
ThisWorkbook.sheets(1).Cells(n, 94).Value = .Range("I10").Value
ThisWorkbook.sheets(1).Cells(n, 95).Value = .Range("I29").Value
ThisWorkbook.sheets(1).Cells(n, 96).Value = .Range("I30").Value
ThisWorkbook.sheets(1).Cells(n, 97).Value = .Range("I31").Value
ThisWorkbook.sheets(1).Cells(n, 98).Value = .Range("I19").Value
ThisWorkbook.sheets(1).Cells(n, 99).Value = .Range("I24").Value
ThisWorkbook.sheets(1).Cells(n, 100).Value = .Range("J8").Value
ThisWorkbook.sheets(1).Cells(n, 101).Value = .Range("J9").Value
ThisWorkbook.sheets(1).Cells(n, 102).Value = .Range("J10").Value
ThisWorkbook.sheets(1).Cells(n, 103).Value = .Range("J29").Value
ThisWorkbook.sheets(1).Cells(n, 104).Value = .Range("J30").Value
ThisWorkbook.sheets(1).Cells(n, 105).Value = .Range("J31").Value
ThisWorkbook.sheets(1).Cells(n, 106).Value = .Range("J19").Value
ThisWorkbook.sheets(1).Cells(n, 107).Value = .Range("J24").Value
ThisWorkbook.sheets(1).Cells(n, 108).Value = .Range("P8").Value
ThisWorkbook.sheets(1).Cells(n, 109).Value = .Range("P9").Value
ThisWorkbook.sheets(1).Cells(n, 110).Value = .Range("P10").Value
ThisWorkbook.sheets(1).Cells(n, 111).Value = .Range("P29").Value
ThisWorkbook.sheets(1).Cells(n, 112).Value = .Range("P30").Value
ThisWorkbook.sheets(1).Cells(n, 113).Value = .Range("P31").Value
ThisWorkbook.sheets(1).Cells(n, 114).Value = .Range("P19").Value
ThisWorkbook.sheets(1).Cells(n, 115).Value = .Range("P24").Value
ThisWorkbook.sheets(1).Cells(n, 116).Value = .Range("S8").Value
ThisWorkbook.sheets(1).Cells(n, 117).Value = .Range("S9").Value
ThisWorkbook.sheets(1).Cells(n, 118).Value = .Range("S10").Value
ThisWorkbook.sheets(1).Cells(n, 119).Value = .Range("S29").Value
ThisWorkbook.sheets(1).Cells(n, 120).Value = .Range("S30").Value
ThisWorkbook.sheets(1).Cells(n, 121).Value = .Range("S31").Value
ThisWorkbook.sheets(1).Cells(n, 122).Value = .Range("S19").Value
ThisWorkbook.sheets(1).Cells(n, 123).Value = .Range("S24").Value
ThisWorkbook.sheets(1).Cells(n, 124).Value = .Range("E1").Value
End With 
 End If 
 If ActiveSheet.Name = "WORK(OPT #1)" Then 
 Else 
 With sheets("WORK(OPT#1)")
ThisWorkbook.sheets(1).Cells(n, 1).Value = .Range("B2").Value
ThisWorkbook.sheets(1).Cells(n, 2).Value = .Range("B3").Value
ThisWorkbook.sheets(1).Cells(n, 3).Value = .Range("D37").Value
ThisWorkbook.sheets(1).Cells(n, 4).Value = .Range("B4").Value
ThisWorkbook.sheets(1).Cells(n, 5).Value = .Range("B5").Value
ThisWorkbook.sheets(1).Cells(n, 6).Value = .Range("I50").Value
ThisWorkbook.sheets(1).Cells(n, 7).Value = .Range("E3").Value
ThisWorkbook.sheets(1).Cells(n, 8).Value = .Range("E2").Value
ThisWorkbook.sheets(1).Cells(n, 9).Value = .Range("B8").Value
ThisWorkbook.sheets(1).Cells(n, 10).Value = .Range("G8").Value
ThisWorkbook.sheets(1).Cells(n, 11).Value = .Range("E12").Value
ThisWorkbook.sheets(1).Cells(n, 12).Value = .Range("E9").Value
ThisWorkbook.sheets(1).Cells(n, 13).Value = .Range("E10").Value
ThisWorkbook.sheets(1).Cells(n, 14).Value = .Range("E33").Value
ThisWorkbook.sheets(1).Cells(n, 15).Value = .Range("E30").Value
ThisWorkbook.sheets(1).Cells(n, 16).Value = .Range("E31").Value
ThisWorkbook.sheets(1).Cells(n, 17).Value = .Range("E19").Value
ThisWorkbook.sheets(1).Cells(n, 18).Value = .Range("E24").Value
ThisWorkbook.sheets(1).Cells(n, 19).Value = .Range("H8").Value
ThisWorkbook.sheets(1).Cells(n, 20).Value = .Range("B51").Value
ThisWorkbook.sheets(1).Cells(n, 21).Value = .Range("B52").Value
ThisWorkbook.sheets(1).Cells(n, 22).Value = .Range("B53").Value
ThisWorkbook.sheets(1).Cells(n, 23).Value = .Range("B54").Value
ThisWorkbook.sheets(1).Cells(n, 24).Value = .Range("D8").Value
ThisWorkbook.sheets(1).Cells(n, 25).Value = .Range("D9").Value
ThisWorkbook.sheets(1).Cells(n, 26).Value = .Range("D10").Value
ThisWorkbook.sheets(1).Cells(n, 27).Value = .Range("D29").Value
ThisWorkbook.sheets(1).Cells(n, 28).Value = .Range("D30").Value
ThisWorkbook.sheets(1).Cells(n, 29).Value = .Range("D31").Value
ThisWorkbook.sheets(1).Cells(n, 30).Value = .Range("E15").Value
ThisWorkbook.sheets(1).Cells(n, 31).Value = .Range("D24").Value
ThisWorkbook.sheets(1).Cells(n, 32).Value = .Range("E50").Value
ThisWorkbook.sheets(1).Cells(n, 33).Value = .Range("E51").Value
ThisWorkbook.sheets(1).Cells(n, 34).Value = .Range("E52").Value
ThisWorkbook.sheets(1).Cells(n, 35).Value = .Range("E53").Value
ThisWorkbook.sheets(1).Cells(n, 36).Value = .Range("E54").Value
ThisWorkbook.sheets(1).Cells(n, 37).Value = .Range("F50").Value
ThisWorkbook.sheets(1).Cells(n, 38).Value = .Range("F51").Value
ThisWorkbook.sheets(1).Cells(n, 39).Value = .Range("F52").Value
ThisWorkbook.sheets(1).Cells(n, 40).Value = .Range("F53").Value
ThisWorkbook.sheets(1).Cells(n, 41).Value = .Range("F54").Value
ThisWorkbook.sheets(1).Cells(n, 42).Value = .Range("G50").Value
ThisWorkbook.sheets(1).Cells(n, 43).Value = .Range("G51").Value
ThisWorkbook.sheets(1).Cells(n, 44).Value = .Range("G52").Value
ThisWorkbook.sheets(1).Cells(n, 45).Value = .Range("G53").Value
ThisWorkbook.sheets(1).Cells(n, 46).Value = .Range("G54").Value
ThisWorkbook.sheets(1).Cells(n, 47).Value = .Range("H50").Value
ThisWorkbook.sheets(1).Cells(n, 48).Value = .Range("H51").Value
ThisWorkbook.sheets(1).Cells(n, 49).Value = .Range("H52").Value
ThisWorkbook.sheets(1).Cells(n, 50).Value = .Range("H53").Value
ThisWorkbook.sheets(1).Cells(n, 51).Value = .Range("H54").Value
ThisWorkbook.sheets(1).Cells(n, 52).Value = .Range("A62").Value
ThisWorkbook.sheets(1).Cells(n, 53).Value = .Range("A63").Value
ThisWorkbook.sheets(1).Cells(n, 54).Value = .Range("A64").Value
ThisWorkbook.sheets(1).Cells(n, 55).Value = .Range("B62").Value
ThisWorkbook.sheets(1).Cells(n, 56).Value = .Range("B63").Value
ThisWorkbook.sheets(1).Cells(n, 57).Value = .Range("B64").Value
ThisWorkbook.sheets(1).Cells(n, 58).Value = .Range("D62").Value
ThisWorkbook.sheets(1).Cells(n, 59).Value = .Range("D63").Value
ThisWorkbook.sheets(1).Cells(n, 60).Value = .Range("D64").Value
ThisWorkbook.sheets(1).Cells(n, 61).Value = .Range("E62").Value
ThisWorkbook.sheets(1).Cells(n, 62).Value = .Range("E63").Value
ThisWorkbook.sheets(1).Cells(n, 63).Value = .Range("E64").Value
ThisWorkbook.sheets(1).Cells(n, 64).Value = .Range("F62").Value
ThisWorkbook.sheets(1).Cells(n, 65).Value = .Range("F63").Value
ThisWorkbook.sheets(1).Cells(n, 66).Value = .Range("F64").Value
ThisWorkbook.sheets(1).Cells(n, 67).Value = .Range("G62").Value
ThisWorkbook.sheets(1).Cells(n, 68).Value = .Range("G63").Value
ThisWorkbook.sheets(1).Cells(n, 69).Value = .Range("G64").Value
ThisWorkbook.sheets(1).Cells(n, 70).Value = .Range("H62").Value
ThisWorkbook.sheets(1).Cells(n, 71).Value = .Range("H63").Value
ThisWorkbook.sheets(1).Cells(n, 72).Value = .Range("H64").Value
ThisWorkbook.sheets(1).Cells(n, 73).Value = .Range("D41").Value
ThisWorkbook.sheets(1).Cells(n, 74).Value = .Range("D42").Value
ThisWorkbook.sheets(1).Cells(n, 75).Value = .Range("D43").Value
ThisWorkbook.sheets(1).Cells(n, 76).Value = .Range("D44").Value
ThisWorkbook.sheets(1).Cells(n, 77).Value = .Range("I44").Value
ThisWorkbook.sheets(1).Cells(n, 78).Value = .Range("I45").Value
ThisWorkbook.sheets(1).Cells(n, 79).Value = .Range("I40").Value
ThisWorkbook.sheets(1).Cells(n, 80).Value = .Range("I43").Value
ThisWorkbook.sheets(1).Cells(n, 81).Value = .Range("L35").Value
ThisWorkbook.sheets(1).Cells(n, 82).Value = .Range("U35").Value
ThisWorkbook.sheets(1).Cells(n, 83).Value = .Range("K12").Value
ThisWorkbook.sheets(1).Cells(n, 84).Value = .Range("I41").Value
ThisWorkbook.sheets(1).Cells(n, 85).Value = .Range("I42").Value
ThisWorkbook.sheets(1).Cells(n, 86).Value = .Range("D46").Value
ThisWorkbook.sheets(1).Cells(n, 87).Value = .Range("A50").Value
ThisWorkbook.sheets(1).Cells(n, 88).Value = .Range("A51").Value
ThisWorkbook.sheets(1).Cells(n, 89).Value = .Range("A52").Value
ThisWorkbook.sheets(1).Cells(n, 90).Value = .Range("A53").Value
ThisWorkbook.sheets(1).Cells(n, 91).Value = .Range("A54").Value
ThisWorkbook.sheets(1).Cells(n, 92).Value = .Range("I8").Value
ThisWorkbook.sheets(1).Cells(n, 93).Value = .Range("I9").Value
ThisWorkbook.sheets(1).Cells(n, 94).Value = .Range("I10").Value
ThisWorkbook.sheets(1).Cells(n, 95).Value = .Range("I29").Value
ThisWorkbook.sheets(1).Cells(n, 96).Value = .Range("I30").Value
ThisWorkbook.sheets(1).Cells(n, 97).Value = .Range("I31").Value
ThisWorkbook.sheets(1).Cells(n, 98).Value = .Range("I19").Value
ThisWorkbook.sheets(1).Cells(n, 99).Value = .Range("I24").Value
ThisWorkbook.sheets(1).Cells(n, 100).Value = .Range("J8").Value
ThisWorkbook.sheets(1).Cells(n, 101).Value = .Range("J9").Value
ThisWorkbook.sheets(1).Cells(n, 102).Value = .Range("J10").Value
ThisWorkbook.sheets(1).Cells(n, 103).Value = .Range("J29").Value
ThisWorkbook.sheets(1).Cells(n, 104).Value = .Range("J30").Value
ThisWorkbook.sheets(1).Cells(n, 105).Value = .Range("J31").Value
ThisWorkbook.sheets(1).Cells(n, 106).Value = .Range("J19").Value
ThisWorkbook.sheets(1).Cells(n, 107).Value = .Range("J24").Value
ThisWorkbook.sheets(1).Cells(n, 108).Value = .Range("P8").Value
ThisWorkbook.sheets(1).Cells(n, 109).Value = .Range("P9").Value
ThisWorkbook.sheets(1).Cells(n, 110).Value = .Range("P10").Value
ThisWorkbook.sheets(1).Cells(n, 111).Value = .Range("P29").Value
ThisWorkbook.sheets(1).Cells(n, 112).Value = .Range("P30").Value
ThisWorkbook.sheets(1).Cells(n, 113).Value = .Range("P31").Value
ThisWorkbook.sheets(1).Cells(n, 114).Value = .Range("P19").Value
ThisWorkbook.sheets(1).Cells(n, 115).Value = .Range("P24").Value
ThisWorkbook.sheets(1).Cells(n, 116).Value = .Range("S8").Value
ThisWorkbook.sheets(1).Cells(n, 117).Value = .Range("S9").Value
ThisWorkbook.sheets(1).Cells(n, 118).Value = .Range("S10").Value
ThisWorkbook.sheets(1).Cells(n, 119).Value = .Range("S29").Value
ThisWorkbook.sheets(1).Cells(n, 120).Value = .Range("S30").Value
ThisWorkbook.sheets(1).Cells(n, 121).Value = .Range("S31").Value
ThisWorkbook.sheets(1).Cells(n, 122).Value = .Range("S19").Value
ThisWorkbook.sheets(1).Cells(n, 123).Value = .Range("S24").Value
ThisWorkbook.sheets(1).Cells(n, 124).Value = .Range("E1").Value
End With 
 End If

ActiveWorkbook.Close False
NotMe:
Next
End With
Application.ScreenUpdating = True
End Sub