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: 1
Default Quick and easy solution needed!


This is the code I have to open a new workbook containing copies of two
worksheets from a previous workbook:


Code:
--------------------

Sub Auto_Open()

Dim NewBook As Workbook
Dim Ctr As Integer

Application.ScreenUpdating = False
Application.DisplayAlerts = False

' Create a new workbook.
Set NewBook = Workbooks.Add

' Copy the two worksheets into the new workbook.
ThisWorkbook.Sheets(Array("Packing Slip", "Invoice - Packing Slip")).Copy _
befo=NewBook.Sheets(1)

' Delete all of the other sheets in the new workbook. The
' initial value of the counter is 1 greater than the number of
' worksheets that you want to copy into the new workbook.
For Ctr = 3 To NewBook.Sheets.Count

NewBook.Sheets(3).Delete

Next

End Sub

--------------------


How would I have the new workbook save as a specified filename in a
specified folder when it is created? For example if the previous
workbook is titled 5500.xls the new workbook would be named
5500.01.xls.

Also, one more quick question for the pros, in a sort of seperate
issue, could a macro add a value (+0.01) to a specified cell in excel?

I am grateful for any help, Sensei!


--
grahamhurlburt
------------------------------------------------------------------------
grahamhurlburt's Profile: http://www.excelforum.com/member.php...o&userid=29878
View this thread: http://www.excelforum.com/showthread...hreadid=495862

 
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
Am I missing some easy solution to my problem? JJ Excel Worksheet Functions 2 September 17th 09 10:42 AM
Anyone got an easy solution DebbieV Excel Discussion (Misc queries) 0 July 4th 08 02:13 AM
Easy solution need for find problem Neil Atkinson Excel Programming 1 October 12th 05 02:46 AM
Quick and easy chisigs2 Excel Worksheet Functions 2 August 24th 05 08:36 PM
Quick and Easy! DBAL[_6_] Excel Programming 3 May 13th 05 08:52 AM


All times are GMT +1. The time now is 10:04 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"