# of sheets in a new workbook
Here is some code...
Sub test()
Dim wbk As Workbook
Dim intSheets As Integer
On Error GoTo Errorhandler
intSheets = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = 4
Set wbk = Workbooks.Add
Errorhandler:
Application.SheetsInNewWorkbook = intSheets
End Sub
As always when changing application level settings it is best to use an
error handler
--
HTH...
Jim Thomlinson
"JT" wrote:
When you programmatically add a new workbook, is it possible to indicate the
number of sheets the new workbook should have?
Thanks for the help.......
--
JT
|