Add WorkSheet Template to current Macro

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
739
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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,191,038
Messages
5,984,279
Members
439,881
Latest member
Amitoj95

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
Top