Save Worksheets as Tab Name plus Cell Value and Date

SuperFerret

Well-known Member
Joined
Mar 2, 2009
Messages
515
Hello,

I want to be able to save worksheets in my workbook as individual workbooks, using the tab name, a cell value and the date (DD MMM Format)

Basically, I have a workbook which we are using to upload to a new system, and we have devised a workbook where only one worksheet has to be completed and the other worksheets are filled in ready.

The problem is I have to have each of these sheets as individual workbooks to load into the system which is very time consuming.

I can't work out how to split the workbook into the 5 sheets, and rename them (should be saved as TABNAME_cellA2value_DD_MMM.xls)

Any help would be appreciated!
 
if your Excel is 2007 or 2010
try this
Code:
Sub Test()
Dim ws As Worksheet, wb As Workbook
Application.DisplayAlerts = False
For Each ws In Sheets
    If ws.Name <> "DATA" Then
        Workbooks.Add
        Set wb = ActiveWorkbook
        With wb
            .SaveAs Filename:="S:\CREATES\" & ws.Name & "_" & ws.Range("A2").Value & "_" & Format(Date, "DD MMM") & ".xlsx"
            ws.Copy Before:=.Sheets(1)
            .Sheets(1).Cells.Copy
            .Sheets(1).Cells.PasteSpecial xlValues
            .Save
            .Close
        End With
    End If
Next ws
Application.DisplayAlerts = True
End Sub
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I need it in .xls as the system won't accept an xlsx, I added FileFormat:=56 to it and it works perfectly!

Thanks for all your help Yahya you're a star!
 
Upvote 0
I'm coming up against a snag. Basically they've decided to shift the folders around (why I don't know) and now there I need to change part of the file ref:

From:
S:\Creates\ME CREATIONS\

To:
S:\Creates\(Cell DATA!Z2) CREATES\

But I don't know how to add this into the code? :-?
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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