Macro Move Sheets

Packfan86

New Member
Joined
Jun 24, 2008
Messages
26
Hey everybody,


I have about 80 sheets in a workbook, and I would like to put each sheet into it's own workbook, and have that new workbook called by the value in Column A. Does anybody know how I would do this?

Thanks in advance!
 
No, in VBA you would use Date

Code:
wb.SaveAs ThisWorkbook.Path & "\" & Format(Date,"yyyymmdd") & "_" & ws.Name & ".xls"

Alter Format as required.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Here's what I came up with & it works B-E-A-U-tifully!!


Sub SaveWS_to_NewWBs()
Dim wb As Workbook
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Copy
Set wb = ActiveWorkbook
wb.SaveAs ThisWorkbook.Path & "\" & ws.Range("A8").Value & " " & ws.Name & " " & ws.Range("X8").Value & " " & Date$ & ".xls"
wb.Close False
Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,222,688
Messages
6,167,644
Members
452,127
Latest member
jayneecm

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