ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a sheet and all formats to a new sheet (https://www.excelbanter.com/excel-programming/431816-copy-sheet-all-formats-new-sheet.html)

Bill

Copy a sheet and all formats to a new sheet
 
I would like to make a macro to copy a sheet to a new sheet. I would like to
include all formats, print areas page setup etc... including a macro button.
I recorded the following. This works except for the button. ANy help??


Sub Macro5()
'
'
Sheets("Current Loan Analysis").Select
ActiveSheet.Unprotect
Sheets("Current Loan Analysis").Select
ActiveSheet.Buttons.Add(1082.25, 34.5, 125.25, 80.25).Select
Sheets("Current Loan Analysis").Copy After:=Sheets(2)
Sheets("Current Loan Analysis (2)").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Current Loan Analysis").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False
Range("J1").Select
End Sub




Don Guillett

Copy a sheet and all formats to a new sheet
 
Something wrong with this??

Sub copysht()
Sheets("Current Loan Analysis").Copy After:=Sheets(Sheets.Count)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bill" wrote in message
...
I would like to make a macro to copy a sheet to a new sheet. I would like
to
include all formats, print areas page setup etc... including a macro
button.
I recorded the following. This works except for the button. ANy help??


Sub Macro5()
'
'
Sheets("Current Loan Analysis").Select
ActiveSheet.Unprotect
Sheets("Current Loan Analysis").Select
ActiveSheet.Buttons.Add(1082.25, 34.5, 125.25, 80.25).Select
Sheets("Current Loan Analysis").Copy After:=Sheets(2)
Sheets("Current Loan Analysis (2)").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Current Loan Analysis").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=
_
False
Range("J1").Select
End Sub





Bill

Copy a sheet and all formats to a new sheet
 
Thanks

"Don Guillett" wrote:

Something wrong with this??

Sub copysht()
Sheets("Current Loan Analysis").Copy After:=Sheets(Sheets.Count)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bill" wrote in message
...
I would like to make a macro to copy a sheet to a new sheet. I would like
to
include all formats, print areas page setup etc... including a macro
button.
I recorded the following. This works except for the button. ANy help??


Sub Macro5()
'
'
Sheets("Current Loan Analysis").Select
ActiveSheet.Unprotect
Sheets("Current Loan Analysis").Select
ActiveSheet.Buttons.Add(1082.25, 34.5, 125.25, 80.25).Select
Sheets("Current Loan Analysis").Copy After:=Sheets(2)
Sheets("Current Loan Analysis (2)").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Current Loan Analysis").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=
_
False
Range("J1").Select
End Sub






ryguy7272

Copy a sheet and all formats to a new sheet
 
Maybe Sub Macro1()
Sheets("Sheet1").Select
Sheets("Sheet1").Copy
End Sub

Also, right-click the button format Control Properties Move and Size
with Cells.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Don Guillett" wrote:

Something wrong with this??

Sub copysht()
Sheets("Current Loan Analysis").Copy After:=Sheets(Sheets.Count)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bill" wrote in message
...
I would like to make a macro to copy a sheet to a new sheet. I would like
to
include all formats, print areas page setup etc... including a macro
button.
I recorded the following. This works except for the button. ANy help??


Sub Macro5()
'
'
Sheets("Current Loan Analysis").Select
ActiveSheet.Unprotect
Sheets("Current Loan Analysis").Select
ActiveSheet.Buttons.Add(1082.25, 34.5, 125.25, 80.25).Select
Sheets("Current Loan Analysis").Copy After:=Sheets(2)
Sheets("Current Loan Analysis (2)").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Current Loan Analysis").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=
_
False
Range("J1").Select
End Sub







All times are GMT +1. The time now is 04:13 AM.

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