Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Worksheets
Hi,
I would like to copy worksheets from one workbook to another using VBA. The source workbook has three worksheets (among others) named, LT, ALISE, FUTURES. I want to copy these three worksheets into a different excel file that already contains these three worksheets (names are identical). How do I go about this? Much appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Worksheets
Hi James,
Try something like: '========= Option Explicit Public Sub Tester() Dim srcWB As Workbook Dim destWB As Workbook Dim arr As Variant arr = VBA.Array("LT", "ALISE", "FUTURES") Set srcWB = Workbooks("myBook,xls") Set destWB = Workbooks("myBook2.xls") With destWB srcWB.Sheets(arr).Copy After:=.Sheets(.Sheets.Count) End With End Sub '<<========= --- Regards. Norman "James" wrote in message ... Hi, I would like to copy worksheets from one workbook to another using VBA. The source workbook has three worksheets (among others) named, LT, ALISE, FUTURES. I want to copy these three worksheets into a different excel file that already contains these three worksheets (names are identical). How do I go about this? Much appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying between Worksheets | Excel Worksheet Functions | |||
copying worksheets | Excel Programming | |||
Copying worksheets | Excel Worksheet Functions | |||
Copying Worksheets | Excel Discussion (Misc queries) | |||
Copying to other worksheets | Excel Discussion (Misc queries) |