Powered by Invision Power Board

Recommended Sites: - VBA Express - JMT Forums - MrExcel - Ozgrid - MS Discussion Groups - John Walkenbach - Chip Pearson - Stephen Bullens Excel Page - xlDynamic (Bob Phillips) - JKP (Jan Karel Pieterse) - The Xcel Files (Ivan F Moala) - The Excel Maniacs (Gareth) - Scriptorium (Rembo) - ExcelKB (XL-Dennis) - and don't forget to register here - it's free!...
  Reply to this topicStart new topic

Save all sheets as new book - no macros
johnske
Posted: January 28, 2008 09:15 am
Quote Post


HardCore MVP
*****

Group: Site Admin
Posts: 454
Member No.: 2
Joined: March 08, 2006



CODE
Sub SaveSheetsAsBook()
     'we want to save a copy of all the sheets
     'in the current workbook as a different
     'workbook - but without macros etc.
     ThisWorkbook.Sheets.Copy
     
     'the copied sheets now become the active workbook
     With ActiveWorkbook
           .SaveAs ActiveWorkbook.Path & "testme.xls" '< set your own path here
           .Close
     End With
End Sub


--------------------------------------------------------------------------------
If I irradiate my cat will that give it eighteen half-lives?

The major part of getting the right answer lies in asking the right question...
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topic