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 copy a worksheet to another Excel Workbook

I am a newbie in VBA and need your help.

I want to do the following from an open Workbook (Destination).

1. Open an Excel Workbook (Source) somewhere on my hard drive - name
of path and file name varies from user to user. Therefore code must
allow user to choose (variable)

2. copy contents of a specific worksheet (Tab name known) to the
active open Workbook (Destination)

The code I have started with this code - (please don't laugh) - but
it lets a lot to be desired.

myFile = Application.GetOpenFilename("All Files,(*.*),*.*")

Workbooks.Open Filename:=myFile
Sheets("Consolidated").Select
Cells.Select
Selection.Copy


I do not know how to bring it into the destination workbook and
specific sheet.

3. Once the cells are copied to the Worksheet, I then want the Soruce
Wprkbook to be closed


Looking forward to your help
 
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
Excel 2007 copy/move worksheet to another workbook Hoekie@work Excel Discussion (Misc queries) 0 June 21st 06 07:27 AM
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
Copy worksheet, code and all, into workbook? Ed[_9_] Excel Programming 2 September 22nd 03 03:11 PM
Copy VB code to other workbook? john Dijkman Excel Programming 3 July 21st 03 01:02 AM


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