Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Workbook with specific number of worksheets
I want to do a Workbook.Add to add a new workbook and I
want it to have 4 worksheets in the workbook. How can I force it to have 4 worksheets? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Workbook with specific number of worksheets
Hi Linda,
It's not hard Application.SheetsInNewWorkbook = 4 Workbooks.Add -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Linda Mac" wrote in message ... I want to do a Workbook.Add to add a new workbook and I want it to have 4 worksheets in the workbook. How can I force it to have 4 worksheets? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Workbook with specific number of worksheets
Hi linda
Try this Sub test() Dim OldValue As Integer Dim a As Integer OldValue = Application.SheetsInNewWorkbook Application.SheetsInNewWorkbook = 4 Workbooks.Add Application.SheetsInNewWorkbook = OldValue End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Linda Mac" wrote in message ... I want to do a Workbook.Add to add a new workbook and I want it to have 4 worksheets in the workbook. How can I force it to have 4 worksheets? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Workbook with specific number of worksheets
numSh = application.SheetsInNewWorkbook
application.SheetsInNewWorkbook = 4 Workbooks.Add application.SheetsInNewWorkbook = numSh -- Regards, Tom Ogilvy "Linda Mac" wrote in message ... I want to do a Workbook.Add to add a new workbook and I want it to have 4 worksheets in the workbook. How can I force it to have 4 worksheets? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Workbook with specific number of worksheets
You can remove the line Linda
Dim a As Integer -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Hi linda Try this Sub test() Dim OldValue As Integer Dim a As Integer OldValue = Application.SheetsInNewWorkbook Application.SheetsInNewWorkbook = 4 Workbooks.Add Application.SheetsInNewWorkbook = OldValue End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Linda Mac" wrote in message ... I want to do a Workbook.Add to add a new workbook and I want it to have 4 worksheets in the workbook. How can I force it to have 4 worksheets? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
link to a specific worksheet of a workbook with many worksheets | Excel Discussion (Misc queries) | |||
Is there a maximum of the number of worksheets in a workbook? | Excel Discussion (Misc queries) | |||
number worksheets in workbook | Excel Discussion (Misc queries) | |||
Counting the number of Worksheets in a Workbook | Excel Worksheet Functions | |||
Count the number of worksheets in a workbook | Excel Discussion (Misc queries) |