Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Workbooks & worksheets
Resolved · Low Priority · Version 2003
Jill has attended:
Excel VBA Intro Intermediate course
How can I split my workbook into lots of different worksheets?
Hi Jill
I don't understand what you are trying to achieve.
A workbook already has multiple worksheets so to increase the number you just add new worksheets.
However if you want to create a new workbook from every worksheet in a workbook you can do the following:
Sub CreateNewWorkbooks()
Dim NewBook As Workbook
Dim OldBook As Workbook
Dim MySheet As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set OldBook = Workbooks(ActiveWorkbook.Name)
For Each MySheet In OldBook.Worksheets
If MySheet.Visible = True Then
MySheet.Copy
ActiveWorkbook.SaveAs Filename:=OldBook.Path & "\" & MySheet.Name , FileFormat:=xlWorkbookNormal
ActiveWorkbook.Close
End If
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Hope this helps
Carlos
Tue 16 Dec 2008: Automatically marked as resolved.
|
Excel tip:Large Icons on toolbarYou can make the buttons on your toolbars bigger by going to Tools / Customize / Options / select Large icons. |
We'll call during UK business hours
Server loaded in 0.07 secs.