Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a worksheet into an open workbook via VBA code
I am trying to insert a worksheet from file into an open workbook with VBA
code. I was wandering what the code needs to look like. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a worksheet into an open workbook via VBA code
"manillla" wrote in message
... I am trying to insert a worksheet from file into an open workbook with VBA code. I was wandering what the code needs to look like. Thanks Hi Manilla Try something like: Sub Tester() Workbooks("Book1.xls").Sheets("YourSheetName").Cop y _ After:=Workbooks("Book2.xls"). _ Sheets(Workbooks("Book2").Sheets.Count) End Sub --- Regards, Norman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a worksheet into an open workbook via VBA code
Hi Manilla,
Sub Tester() Workbooks("Book1.xls").Sheets("YourSheetName").Cop y _ After:=Workbooks("Book2.xls"). _ Sheets(Workbooks("Book2").Sheets.Count) End Sub should have read: Sub Tester() Workbooks("Book1.xls").Sheets("YourSheetName").Cop y _ After:=Workbooks("Book2.xls"). _ Sheets(Workbooks("Book2.xls").Sheets.Count) End Sub (The ".xls" was missing from the last instance of "Book2"). --- Regards, Norman "Norman Jones" wrote in message ... "manillla" wrote in message ... I am trying to insert a worksheet from file into an open workbook with VBA code. I was wandering what the code needs to look like. Thanks Hi Manilla Try something like: Sub Tester() Workbooks("Book1.xls").Sheets("YourSheetName").Cop y _ After:=Workbooks("Book2.xls"). _ Sheets(Workbooks("Book2").Sheets.Count) End Sub --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need VB code for workbook open to open a link | Excel Discussion (Misc queries) | |||
INserting a worksheet from one workbook to another workbook | New Users to Excel | |||
Code to open new workbook | Excel Programming | |||
Workbook Open code | Excel Programming | |||
Workbook Open code | Excel Programming |