ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set No of Sheets in new workbook (https://www.excelbanter.com/excel-programming/287083-set-no-sheets-new-workbook.html)

cornishbloke[_20_]

Set No of Sheets in new workbook
 
Hopefully a quickie for someone ;)

When using the VBA code:

workbooks.add

how do I determine the number of sheets in that newly created workboo
(i.e rather than using the value set in excel's options on eac
individual pc)

--
Message posted from http://www.ExcelForum.com


shades

Set No of Sheets in new workbook
 
Application.SheetsInNewWorkbook = 5

Change the number to suit your purposes.


---
Message posted from http://www.ExcelForum.com/


cornishbloke[_21_]

Set No of Sheets in new workbook
 
exactly what I was looking for, thanks! :D


---
Message posted from http://www.ExcelForum.com/


Bob Phillips[_6_]

Set No of Sheets in new workbook
 
Workbooks.Add
cSheets = ActiveWorkbook.Worksheets.Count

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"cornishbloke " wrote in
message ...
Hopefully a quickie for someone ;)

When using the VBA code:

workbooks.add

how do I determine the number of sheets in that newly created workbook
(i.e rather than using the value set in excel's options on each
individual pc)?


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com