PC Review


Reply
Thread Tools Rate Thread

Copy a worksheet

 
 
Nev
Guest
Posts: n/a
 
      1st Mar 2010
H Guys

can you help. i want to copy a sheet from a closed book into an open book
via vba macro.
Example is - run code to open the workbook, copy the only worksheet in that
book and paste it into an existing sheet in a workbook that is already open.

Can u help

Thanks

Nev
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      2nd Mar 2010
You left a lot of unanswered questions so I took some liberties. You will
have to change the name "Somefile" to the actual workbook name that you want
to copy from.

Sub cpySht()
Dim wb1 As Workbook, wb2 As Workbook
Set wb1 = ActiveWorkbook
myPath = wb1.Path
fName= myPath & "Somefile.xls" <<<Sustitute actual wb name
Worbooks.Open fName
Set wb2 = ActiveWorkbook
wb2.Sheets(1).Cells.Copy wb1.Sheets(Sheets.Count).Range("A1")
Application.CutCopyMode = False
End Sub


"Nev" <(E-Mail Removed)> wrote in message
news:963A660E-6B42-4D37-BE2F-(E-Mail Removed)...
>H Guys
>
> can you help. i want to copy a sheet from a closed book into an open book
> via vba macro.
> Example is - run code to open the workbook, copy the only worksheet in
> that
> book and paste it into an existing sheet in a workbook that is already
> open.
>
> Can u help
>
> Thanks
>
> Nev



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending copy worksheet to mailrecipient - mail adress indicated incell in worksheet Snoopy Microsoft Excel Discussion 1 19th Aug 2009 12:51 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Microsoft Excel Worksheet Functions 4 7th Sep 2006 05:05 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Microsoft Excel Worksheet Functions 0 7th Sep 2006 03:37 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 2 22nd Sep 2004 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 0 22nd Sep 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:07 PM.