Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default copy format to new sheet

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy format to new sheet


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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default copy format to new sheet

worked GREAT!

thanx!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy conditional format from one sheet to another using VBA KrisN Excel Programming 0 June 23rd 08 08:45 PM
How to copy a conditional format from one sheet to another? billz Excel Discussion (Misc queries) 1 February 15th 07 10:33 PM
Help: copy sheet format ernie Excel Programming 1 September 4th 06 06:43 PM
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
How do I copy a print format from sheet to sheet in excel ? kernat Excel Discussion (Misc queries) 1 July 22nd 05 04:59 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"