Copy a worksheet from a workbook

  • Thread starter Thread starter BRABUS
  • Start date Start date
B

BRABUS

Ok I am sure this has been covered a million times but I am strugglin
to find something that will help me so I appologise up front.

I am working with XL 2003 SP3 and have a spreadsheet (lets say it
called "ORIGINAL") that is open and running a macro. During this macr
I would like it to open another spreadsheet (lets say its calle
"SECONDARY") and copy a worksheet called "Sheet1" and then paste i
back into the "ORIGINAL" spreadsheet.

I have tried various methods and get constantly changing results. Doe
anyone have any very simple code PLEEEEEEEEEASE
 
The macro recorder is your friend. Try it and then post back with questions.
 
I have re-recorded a macro to do the copying, but when I run the macro
using a keyboard shortcut it stops once it opens the Secondary.MHTML
file


This is the macro

Sub OpenWorkbookAndCopySheet()
'
' OpenWorkbookAndCopySheet Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Workbooks.Open Filename:="C:\Secondary.MHTML"
Cells.Select
Range("C1").Activate
Selection.Copy
Windows("Original.xls").Activate
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
Windows("Secondary.MHTML").Activate
ActiveWindow.Close
Range("A1").Select
Sheets("Sheet1").Select


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

Back
Top