PC Review


Reply
Thread Tools Rate Thread

Copy a sheet and all formats to a new sheet

 
 
Bill
Guest
Posts: n/a
 
      30th Jul 2009
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



 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      30th Jul 2009
Something wrong with this??

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Bill" <(E-Mail Removed)> wrote in message
news:BE473EB9-ED7A-43E6-B5AF-(E-Mail Removed)...
>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
>
>
>


 
Reply With Quote
 
Bill
Guest
Posts: n/a
 
      30th Jul 2009
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
> (E-Mail Removed)
> "Bill" <(E-Mail Removed)> wrote in message
> news:BE473EB9-ED7A-43E6-B5AF-(E-Mail Removed)...
> >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
> >
> >
> >

>
>

 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      30th Jul 2009
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
> (E-Mail Removed)
> "Bill" <(E-Mail Removed)> wrote in message
> news:BE473EB9-ED7A-43E6-B5AF-(E-Mail Removed)...
> >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
> >
> >
> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/Paste Values & Formats from each Sheet & Book in Folder A to B. u473 Microsoft Excel Programming 0 25th Nov 2007 02:25 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Microsoft Excel Programming 4 5th Oct 2007 04:00 PM
Save copy of active sheet - values and formats only Lance Fairway Microsoft Excel Discussion 1 18th Aug 2006 03:03 AM
copy a sheet with all formats - column widths, etc? =?Utf-8?B?UmljaA==?= Microsoft Excel Programming 2 26th Apr 2005 09:10 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. =?Utf-8?B?Um9uTWM1?= Microsoft Excel Misc 9 3rd Feb 2005 12:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:51 PM.