Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
wayliff wrote:
Workbooks.Add Windows("TC Report.xls").Activate Sheets(Array("ST Report", "EF Report")).Select Sheets("EF Report").Activate Sheets(Array("ST Report", "EF Report")).Copy Befo=Workbooks("Book1").Sheets _ (1) Windows("TC Report.xls").Activate Sheets("ST Report").Select Dim wb As Workbook Set wb = Workbooks.Add Workbooks("TC Report.xls").Sheets(Array("ST Report", "EF Report")).Copy _ Befo=wb.Sheets(1) -- Dick Kusleika MVP-Excel www.dailydoseofexcel.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you so much for your help... This is where I can see that I have way to go in code efficiency an knowledge.. -- waylif ----------------------------------------------------------------------- wayliff's Profile: http://www.excelforum.com/member.php...fo&userid=2986 View this thread: http://www.excelforum.com/showthread.php?threadid=49603 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
wayliff wrote:
Thank you so much for your help... You're welcome. This is where I can see that I have way to go in code efficiency and knowledge... Well, you're on your way. Here's some more info on selecting and activating: http://www.dicks-blog.com/archives/2...-and-activate/ -- Dick Kusleika MVP-Excel www.dailydoseofexcel.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
run code on opening workbook and apply code to certain sheets | Excel Programming | |||
Sheets select method fails when workbook is opened by another workbook | Excel Programming | |||
Code to Select Row | Excel Programming | |||
Select other workbook to select data in a macro. | Excel Programming |