Excel Saving one sheet in a workbook :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Saving one sheet in a workbook
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

JG71
Board Regular


Joined: 01 Nov 2002
Posts: 22


Status: Offline

 Reply with quote  

Hello,
Is it possilble to have the information in a workbook save one or more sheets and not save others? Thanks

Post Fri Nov 01, 2002 7:53 pm 
 View user's profile Send private message

Raider
Board Master


Joined: 27 Oct 2002
Posts: 394
Location: Turkiye
Flag: Turkey

Status: Offline

 Reply with quote  

i guess no, unless you create a new workbook and copy the needed sheets to this new woorkbook via VBA

Post Fri Nov 01, 2002 7:56 pm 
 View user's profile Send private message Send e-mail

Ekim
Board Master


Joined: 01 Jul 2002
Posts: 995
Location: Perth, Australia
Flag: Australia

Status: Offline

 Reply with quote  

Put the following macro in a standard module.

The macro saves sheet2 and sheet4 to the C:My DocumentsTemp directory. Change to suit (add more lines to the macro if you wish to save more sheets).


Sub CopySheets()

Dim NWB As Workbook ' New Workbook
Dim NewName As String
Dim OWB As Workbook ' Old WorkBook
Dim dPath As String
dPath = "C:My DocumentsTemp" 'Change to suit

Application.ScreenUpdating = False

NewName = ""
NewName = InputBox("Enter New Book Name without .xls")

Set OWB = ActiveWorkbook
Set NWB = Workbooks.Add

OWB.Sheets("Sheet2").Copy NWB.Sheets(1)
OWB.Sheets("Sheet4").Copy NWB.Sheets(1)


NWB.SaveAs FileName:=dPath & NewName + ".xls"
Application.ScreenUpdating = True

End Sub




HTH

Mike




[ This Message was edited by: Ekim on 2002-11-01 19:49 ]

Post Sat Nov 02, 2002 12:44 am 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.