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 VBA code to always select next available new workbook


Hi

I have a macro that adds a new workbook and copies two sheets to it
However the macro crashes if the new workboox is not book1 and it i
kind of a bummer.
I have not been able to figure how to code something to just look a
the newest workbook and copying the stuff...without vba looking a
book1 as the new workbook...just whatever is available.

Here's what I currently have...help appreciated.

Workbooks.Add
Windows("TC Report.xls").Activate
Sheets(Array("ST Report", "EF Report")).Select
Sheets("EF Report").Activate
Sheets(Array("ST Report", "EF Report")).Cop
Befo=Workbooks("Book1").Sheets _
(1)
Windows("TC Report.xls").Activate
Sheets("ST Report").Selec

--
waylif
-----------------------------------------------------------------------
wayliff's Profile: http://www.excelforum.com/member.php...fo&userid=2986
View this thread: http://www.excelforum.com/showthread.php?threadid=49603

 
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
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
Sheets select method fails when workbook is opened by another workbook Mike Excel Programming 2 June 8th 04 04:17 AM
Code to Select Row David McRitchie[_2_] Excel Programming 0 September 19th 03 11:02 PM
Select other workbook to select data in a macro. T Tromp Excel Programming 2 September 19th 03 01:43 PM


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