Copiying entire sheet into another workbook to the designated sheet

ADAEKIN

New Member
Joined
Dec 28, 2011
Messages
4
Hi everyone,

I hope you can help me with this. I have below code to use for copying data on the entire sheet (Sheet1 of source the workbook) to the Sheet2 (tab name "Data") in the destination workbook. My problem is that the code copies Sheet1 from Source workbook into th destination Workbook as a new sheet/tab and not over or into the Sheet2 (Data tab) of the Destination Workbook. All the macros and formulas work based on the data available in the Sheet2 (Data tab) of the destination Workbook but it is blank since the data I am trying to copy from the Soyrce Workbook is being added as a new heet/tab and not being copied into the Sheet2 (Data tab) of the Destination Workbook. Any help to fix this is greatly appriciated!!!! Thanks a lot in advance!!!
:)

Sub CreateLocal3()

'Copy Data into the template'

Dim wkbSource As Workbook
Dim wkbDest As Workbook
Dim shtToCopy As Worksheet

Set wkbSource = ActiveWorkbook
Set wkbDest = Workbooks.Open("C:\Documents and Settings\skazan200\Desktop\POLITICAL\Templates\TEMPs for macro\LUR Calculator 2012 ZONE - Philly temp")
Set shtToCopy = wkbSource.Sheets(1)
shtToCopy.Copy wkbDest.Sheets(2)

ActiveWorkbook.Saveas "C:\Documents and Settings\skazan200\Desktop\POLITICAL\2012 Reports\LOCAL\LUR Calculator 2012 ZONE - Philly" & ".xlsm"

ActiveWorkbook.Close

End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I don't think is possible, you can use
Code:
shtToCopy.Copy After:=wkbDest.Sheets(1)
but not paste in the existing sheet2, otherwise you have to copy contents of wkbSource.Sheets(1) into wkbDest.Sheets(2)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top