Code:
'#### IN THE WORKBOOK ####
Public ShtCount As Integer
'Set up a integer variable to keep track of the workbooks
'number of sheets - declaring this publically means that this
'variables accessible to all the subs through out the project
'the worksheet and related worksheets
Private Sub Workbook_Open()
'when this workbook first opens ...
ShtCount = Worksheets.Count
'set the value of our integer variable to the
'count of the number of worksheets
End Sub
'#### IN THE WORKSHEET ####
Private Sub Command1_Click()
If Worksheets.Count < ShtCount Then
Worksheets.Add
Worksheets(ShtCount).Select
'add a new worksheet and select it
ShtCount = ShtCount + 1
'update our number count of sheets by 1
End If
End Sub