PC Review


Reply
Thread Tools Rate Thread

copy format to new sheet

 
 
J.W. Aldridge
Guest
Posts: n/a
 
      6th May 2009
This code works fine... Just need to add second command to also copy
format of Range ("a14:f44")
from "Ind Templates" to new sheet.



Private Sub Workbook_newsheet(ByVal Sh As Object)
Sheets("Ind Templates").Range("A1:f13").Copy Sh.Range("a1")
End Sub


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      6th May 2009

Option Explicit
Private Sub Workbook_newsheet(ByVal Sh As Object)

with workSheets("Ind Templates")
.Range("A1:f13").Copy _
destination:=Sh.Range("a1")

.range("a14:f44").copy
sh.range("a14").pastespecial paste:=xlpasteformats

end with

End Sub

I made some minor changes that don't matter, but that I find makes the code
easier to read.



"J.W. Aldridge" wrote:
>
> This code works fine... Just need to add second command to also copy
> format of Range ("a14:f44")
> from "Ind Templates" to new sheet.
>
> Private Sub Workbook_newsheet(ByVal Sh As Object)
> Sheets("Ind Templates").Range("A1:f13").Copy Sh.Range("a1")
> End Sub


--

Dave Peterson
 
Reply With Quote
 
J.W. Aldridge
Guest
Posts: n/a
 
      6th May 2009
worked GREAT!

thanx!
 
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
Help: copy sheet format =?Utf-8?B?ZXJuaWU=?= Microsoft Excel Programming 1 4th Sep 2006 06:43 PM
VB code to copy sheet format to another sheet =?Utf-8?B?QVNV?= Microsoft Excel Misc 12 10th Aug 2006 02:37 AM
How do I format a sheet using a copy macro? =?Utf-8?B?TmltYnVzNTU=?= Microsoft Excel Programming 1 1st Apr 2006 04:46 AM
How do I copy a print format from sheet to sheet in excel ? =?Utf-8?B?a2VybmF0?= Microsoft Excel Misc 1 22nd Jul 2005 04:59 PM
format change on Copy sheet Glenn Microsoft Excel Misc 2 17th May 2004 05:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.