Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default 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
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
Copying between Worksheets LongTermNoob Excel Worksheet Functions 5 January 3rd 08 07:00 PM
copying worksheets excel-tr Excel Programming 3 April 1st 07 09:56 AM
Copying worksheets Mick Excel Worksheet Functions 5 February 25th 07 11:33 PM
Copying Worksheets TamW Excel Discussion (Misc queries) 1 October 4th 05 04:12 PM
Copying to other worksheets Putz Excel Discussion (Misc queries) 1 September 4th 05 06:29 PM


All times are GMT +1. The time now is 03:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"