workbooks worksheets

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

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

Workbooks & worksheets

resolvedResolved · Low Priority · Version 2003

Jill has attended:
Excel VBA Intro Intermediate course

Workbooks & worksheets

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

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.


 

Excel tip:

Large Icons on toolbar

You can make the buttons on your toolbars bigger by going to Tools / Customize / Options / select Large icons.

View all Excel hints and tips


Server loaded in 0.07 secs.