Copy and overwriting sheets

jsolomon

Board Regular
Joined
Mar 25, 2005
Messages
109
Hi,
Is there any way to copy a sheet from one book to another and have it overwrite the sheet insead of it renaming it?

Thanks,

Joe
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,367
Office Version
  1. 365
Platform
  1. Windows
Joe

What exactly do you mean?

Do you want to copy the data from 1 workbook to a pre-existing sheet in another workbook?
Code:
Workbooks("Book1.xls").Worksheets("Sheet1").Cells.Copy Workbooks("Book2.xls").Worksheets("Sheet2").Range("A1")
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,367
Office Version
  1. 365
Platform
  1. Windows
Sorry I still don't get what you mean.

Can you explain further?

The code I posted will copy everything.
 
Upvote 0

jsolomon

Board Regular
Joined
Mar 25, 2005
Messages
109
ADVERTISEMENT
I want to copy Sheet 1 from Source workbook to Sheet 1 in Destination workbook. I would like it to overwrite Sheet 1 in the Dest. book. I tried the code you suggested, and everything but the Reference Names are copying over. Any other ideas? Thanks for your help.

Joe
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,367
Office Version
  1. 365
Platform
  1. Windows
Joe

What do you mean by 'Reference Names'?
 
Upvote 0

jsolomon

Board Regular
Joined
Mar 25, 2005
Messages
109
ADVERTISEMENT
like when you go to insert, names, define and assign an array to a name
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,367
Office Version
  1. 365
Platform
  1. Windows
So you mean a named range?
Code:
Workbooks("Book1.xls").Worksheets("Sheet1").Copy After:=Workbooks("Book2.xls").Worksheets("Sheet2").
I still don't quite understand what you mean by this.
have it overwrite the sheet insead of it renaming it?
 
Upvote 0

jsolomon

Board Regular
Joined
Mar 25, 2005
Messages
109
when i right click the sheet tab, hit copy, and copy it over, becasue the other one has the same name it will just rename it 'Sheet1 (1)'
 
Upvote 0

Forum statistics

Threads
1,195,642
Messages
6,010,885
Members
441,571
Latest member
stolenweasel

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
Top