PDA

View Full Version : [SOLVED:] Macro to Take a Worksheet from One workbook and Move it to Another



trevor2524
09-04-2014, 07:17 AM
Does anybody know a code that will take the worksheet found on an open workbook and move it to another workbook that is also open. This way I can transfer values easier. Any suggestions? Thanks for your help.

mancubus
09-04-2014, 07:32 AM
With Workbooks("DestinationWorkbook.xlsm")
Workbooks("SourceWorkbook.xlsm").Worksheets("SourceWorksheet").Copy _
After:=.Worksheets(.Worksheets.Count)
End With

trevor2524
09-04-2014, 07:49 AM
ok so say the worksheet I want Transferred is Called MIA2 and is in the file MIA.xlsm. The Workbook I want it transferred too is called testprocess.xlsm. How would that look with your coding.

mancubus
09-04-2014, 08:04 AM
names in the code:
Source = From workbook
Destination = To workbook

just replace the names according to this.

if you want to move the worksheet and not copy, Replace Copy with Move in the code.

trevor2524
09-04-2014, 08:39 AM
Thank You.

mancubus
09-04-2014, 11:11 PM
you are welcome. thnaks for marking the thread as solved.