Add WorkSheet Template to current Macro

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
751
Office Version
  1. 365
Platform
  1. Windows
i have this set of commands that generates a worksheet...BUT i want it to generate a TEMPLATE not just another worksheet, here is the path to the template and the SUB() that generates a worksheet .... just not sure where or how to place the path...

PATH= "C:\Documents and Settings\Microsoft\Templates\Analysis1.xlt"

------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
Target.Value = UCase(Target.Value)

For Each ws In ThisWorkbook.Worksheets
If ws.Name = Target.Value Then Exit Sub
Next ws

shtName = Target.Value

Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = shtName

Sheets("SYMBOL LIST").Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select

End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,011
Messages
6,122,680
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top