Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
paste named range for each new sheet created
Exsisting sheet (Error Counter) has two named ranges.
Error_Count Error_Label How to automatically paste these two ranges to each sheet created in workbook. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
paste named range for each new sheet created
Copy the following sub into ThisWorkbook module. It will insert the named
ranges in any worksheet that is activated; not just the added worksheets (which are activaed by default when added). If you want to exclude any existing worksheets then put an if statement at the start of the sub and exit the sub if necessary. Private Sub Workbook_SheetActivate(ByVal Sh As Object) On Error GoTo Create_Named_Ranges Sh.Range("Error_Count").Select Sh.Range("Error_Label").Select Exit Sub Create_Named_Ranges: With ActiveWorkbook.Worksheets(Sh.Name).Names .Add Name:="Error_Count", _ RefersToR1C1:=Sh.Range("A1") .Add Name:="Error_Label", _ RefersToR1C1:=Sh.Range("B1") End With End Sub -- Regards, OssieMac "J.W. Aldridge" wrote: Exsisting sheet (Error Counter) has two named ranges. Error_Count Error_Label How to automatically paste these two ranges to each sheet created in workbook. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
paste named range for each new sheet created
Thanx, but I dont think I was quite clear...
I need the data (formulas & names & formats) within the original named range on the existing sheet "Error Counter" to be pasted on each sheet created. Thanx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
paste named range for each new sheet created
Thanx again, but found something that works!
Private Sub Workbook_newsheet(ByVal Sh As Object) Sheets("ERROR COUNTER").Range("A1:I1").Copy Sh.Range("a1") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Accessing a macro created named range | Excel Programming | |||
Finding a named range based on cell value and copy/paste to same sheet? | Excel Programming | |||
Copy/paste the template whenever new sheet is created | Excel Programming | |||
Paste a named range to another range in Excel | Excel Discussion (Misc queries) | |||
New Named Range Created Each Time Data Imported into Excel via Macro | Excel Programming |