Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my last question I was looking for a way to check or uncheck a tick box to insert or remove a new sheet in a workbook.
I know I can create a new workbook based on an excel template file, can I combine these two steps and set the macro below to create a new worksheet, based on a template, in the existing workbook? Previous macro was Public Sub CheckBox1_Click() Const sSHEETNAME As String = "My New Sheet" On Error Resume Next With ActiveSheet If .CheckBoxes(Application.Caller).Value = xlOn Then With Worksheets.Add(After:=Sheets(Sheets.Count)) .Name = sSHEETNAME .Range("A1").Value = "Related Text" End With .Select 'Restore selection to calling sheet Else Application.DisplayAlerts = False Worksheets(sSHEETNAME).Delete Application.DisplayAlerts = True End If End With On Error GoTo 0 End Sub -- Roger W |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Making a macro on a template update with new each new sheet create | Excel Discussion (Misc queries) | |||
Create, name, open, and enter data in new sheet - from template | Excel Discussion (Misc queries) | |||
quickly create extra copies of a worksheet template in a workbook | Excel Worksheet Functions | |||
new sheet created 'on the fly' from template in same workbook - H. | Excel Worksheet Functions | |||
Best way to create a workbook template that allows data entry and purchase order req to be created from it | Excel Programming |