ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Without Code (https://www.excelbanter.com/excel-programming/414875-copy-without-code.html)

BillCPA

Copy Without Code
 
Sheet1 in a workbook has code behind it. Is there any way to create a copy
of that worksheet in the workbook and not have the code go with it?

--
Bill @ UAMS

Mike H

Copy Without Code
 
Hi,

Put this in a general module and it will copy the active sheet to a new
sheet with (copy) as an extension

Sub MakeCopy()
myname = ActiveSheet.Name
Application.DisplayAlerts = False
Sheets.Add().Name = ActiveSheet.Name & "(Copy)"
Worksheets(myname).UsedRange.Copy _
Destination:=Worksheets(myname & "(Copy)").Cells(1, 1)
Application.DisplayAlerts = True
End Sub

Mike

"BillCPA" wrote:

Sheet1 in a workbook has code behind it. Is there any way to create a copy
of that worksheet in the workbook and not have the code go with it?

--
Bill @ UAMS


BillCPA

Copy Without Code
 
Thank you, sir! I made some minor modifications, but that gave me what I
needed.

--
Bill @ UAMS


"Mike H" wrote:

Hi,

Put this in a general module and it will copy the active sheet to a new
sheet with (copy) as an extension

Sub MakeCopy()
myname = ActiveSheet.Name
Application.DisplayAlerts = False
Sheets.Add().Name = ActiveSheet.Name & "(Copy)"
Worksheets(myname).UsedRange.Copy _
Destination:=Worksheets(myname & "(Copy)").Cells(1, 1)
Application.DisplayAlerts = True
End Sub

Mike

"BillCPA" wrote:

Sheet1 in a workbook has code behind it. Is there any way to create a copy
of that worksheet in the workbook and not have the code go with it?

--
Bill @ UAMS



All times are GMT +1. The time now is 02:42 PM.

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