PC Review


Reply
Thread Tools Rate Thread

Copy and paste contents of one sheet into another

 
 
Darin Kramer
Guest
Posts: n/a
 
      20th Aug 2007


Hi,

Ive got two books open, say book a and book b.

I need to systematically go through all the sheets in Book A and for
each sheet select all cells, copy, and then goto the sheet in Book B
(with the same name, but which is blank) and paste all the cells.

Your expert held would be most appreciated by me (not so expert!)

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      20th Aug 2007
Darin,

try something like this:

Sub test()
Dim sh As Worksheet

For Each sh In Workbooks("A.xls").Worksheets
sh.Cells.Copy
Destination:=Workbooks("B.xls").Worksheets(sh.Name).Cells(1, 1)
Next sh

End Sub


--
Hope that helps.

Vergel Adriano


"Darin Kramer" wrote:

>
>
> Hi,
>
> Ive got two books open, say book a and book b.
>
> I need to systematically go through all the sheets in Book A and for
> each sheet select all cells, copy, and then goto the sheet in Book B
> (with the same name, but which is blank) and paste all the cells.
>
> Your expert held would be most appreciated by me (not so expert!)
>
> Regards
>
> D
>
> *** Sent via Developersdex http://www.developersdex.com ***
>

 
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
OLEObjects - Paste combobox contents to a sheet James Microsoft Excel Programming 4 4th Apr 2009 02:11 PM
Copy Paste from Class Sheet to Filtered List on Combined Sheet prkhan56@gmail.com Microsoft Excel Programming 6 16th Sep 2008 04:30 PM
Help to code Macro to Copy fron one sheet and paste in other sheet kay Microsoft Excel Programming 3 25th Jul 2008 06:46 PM
copy and paste contents of sheet michlite@gmail.com Microsoft Excel Programming 1 15th Nov 2006 04:02 PM
Cannot paste contents to another sheet JohnnyMo Microsoft Excel Misc 0 5th Nov 2003 08:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 AM.