Copy and paste contents of one sheet into another

D

Darin Kramer

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 ***
 
V

Vergel Adriano

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top