workbooks worksheets
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Workbooks & worksheets

Workbooks & worksheets

resolvedResolved · Low Priority · Version 2003

replyReply Mon 1 Dec 2008, 16:26Delegate Jill said...

Jill has attended:
Excel VBA Intro Intermediate course

Workbooks & worksheets

How can I split my workbook into lots of different worksheets?

For upcoming training course dates see: Pricing & availability

replyReply Wed 10 Dec 2008, 09:50Trainer Carlos said...

RE: Workbooks & 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.

 

Please browse our web site to find out more about
introduction excel training and other Microsoft training courses.

Excel tip:

Pivot table grouping

If you want to group items in a pivot table together, simply highlight the labels for the fields either with the shift key (if adjacent)or with the contral key if they are not next to each other.
Right click and choose group. Give the cell a name.

When you double click on this cell it will either expamd or collapse your grouped area

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard