Printing/saving excel workbook with multiple tabs as singular excel files based on cell content

thmartin

New Member
Joined
Mar 3, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have an excel file containing multiple tabs that i need to print/save as individual excel files. The name of each excel file is a given cell on the individual worksheet.

Example:

Sheet1 cell C6 = "Target Revenue" - I would need to print a new excel file saved in the same folder named "Target Revenue" containing the contents of just Sheet1
Sheet2 cell C6 = "Target GP" - I would need to print a new excel file saved in the same folder named "Target GP" containing the contents of just Sheet2

There are numerous tabs, and i have been doing this manually with the "Move or Copy" feature, but i feel as though there must be an easier way.

Thanks,
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this macro.
VBA Code:
Public Sub Save_Each_Sheet_As_Workbook()

    Dim ws As Worksheet
    
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False  'suppress warning if .xlsx file already exists - file is replaced
    
    With ActiveWorkbook
        For Each ws In .Worksheets
            ws.Copy
            ActiveWorkbook.SaveAs .Path & "\" & Range("C6").Value & ".xlsx"
            ActiveWorkbook.Close SaveChanges:=False
        Next
    End With
    
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
    MsgBox "Done"
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top