LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default worksheet to workbook macro

Try this one

It will save each sheet in C:\ with the name of the sheet

Sub test()
Dim a As Integer
Dim wb As Workbook
Application.ScreenUpdating = False
For a = 1 To ThisWorkbook.Worksheets.Count
ThisWorkbook.Sheets(a).Copy
Set wb = ActiveWorkbook
wb.SaveAs "C:\" & wb.Sheets(1).Name & ".xls"
wb.Close False
Set wb = Nothing
Next a
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"lyric2002" wrote in message ...
I am a novice when it comes to macros. I know how to record but am wondering if what I need needs to be written in VB.

I have a worksheet consisting of multiple pages. I have been tasked to copy each page in the worksheet to a seperate workbook.

Does anyone have any code that can do this? Is it possible?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Copying Worksheet to New Workbook MGC Excel Discussion (Misc queries) 10 August 17th 07 01:57 AM
Macro add worksheet to workbook automatically Davin Excel Discussion (Misc queries) 0 February 17th 06 05:36 PM
[Fwd: Run macro on exit worksheet/workbook] toontje Excel Discussion (Misc queries) 1 August 5th 05 03:49 AM
Run macro on exit worksheet/workbook toontje Excel Worksheet Functions 3 August 2nd 05 10:15 PM
Macro for worksheet to workbook Brian Excel Programming 2 December 23rd 03 08:00 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"