Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Am I missing some easy solution to my problem? | Excel Worksheet Functions | |||
Anyone got an easy solution | Excel Discussion (Misc queries) | |||
Easy solution need for find problem | Excel Programming | |||
Quick and easy | Excel Worksheet Functions | |||
Quick and Easy! | Excel Programming |