ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Duplicating worksheet by VBA (https://www.excelbanter.com/excel-programming/318169-duplicating-worksheet-vba.html)

Jack Sheet

Duplicating worksheet by VBA
 
Hi all

I expect that this wheel has already been invented, so grateful for any
help.

I want a VBA routine that mimics the effect of Edit/Move or Copy Sheet (with
the "Copy" box checked)
but with the following differences from the treatment desplayed by the
Edit/... method:

1) If a cell in the source sheet refers to a global (ie workbook level)
name, then the Edit/Copy Sheet method results in the creation of a name
local to the newly created sheet. I do not want this (new, local) name to
be created. Affected cells in the newly created sheet should refer to the
same global name as the cell in the source sheet.

2) If a cell in the source sheet refers to a name that is local to another
sheet that is NOT being simultaneously duplicated, then the equivalent cell
in the newly created sheet should refer to the same local name, without the
creation of additional names containing errors.

Thanks in advance


--
Return email address is not as DEEP as it appears




All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com