Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Open workbook with x number of sheets

Hi
Using Office Pro 2003 & WinXP

Is it possible to set the number of sheets when opening a new Workbook
without changing the default .SheetsInNewWorkbook of 3.

I was searching this newsgroup and came across the following in a Jim Becker
post of 17-Dec 2002.

Is this the only way to open a new workbook with a specific number of sheets?

Code is courtesy of Ed Ferrero (12.02.02):

Dim curr_sheets As Integer
With Application
' save the no of sheets in new book that is currently set in options
curr_sheets = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 3
Workbooks.Add
.SheetsInNewWorkbook = curr_sheets
End With


--
Thank you

Regards

Bob C
Using Windows XP Home + Office 2003 Pro
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Open workbook with x number of sheets

that's the code I use too...
and I take it so does the rest as indeed there seems to be no other way.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

?B?Um9iZXJ0IENocmlzdGll?= wrote in message
:

Hi
Using Office Pro 2003 & WinXP

Is it possible to set the number of sheets when opening a new Workbook
without changing the default .SheetsInNewWorkbook of 3.

I was searching this newsgroup and came across the following in a Jim
Becker post of 17-Dec 2002.

Is this the only way to open a new workbook with a specific number of
sheets?

Code is courtesy of Ed Ferrero (12.02.02):

Dim curr_sheets As Integer
With Application
' save the no of sheets in new book that is currently set in options
curr_sheets = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 3
Workbooks.Add
.SheetsInNewWorkbook = curr_sheets
End With



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Open workbook with x number of sheets

Thanks keepITcool

Jim Beckers post nearly 2 years old - thought maybe the newer 2003 excel may
have included it.

Keep up the good work

Regards Bob C.

"keepITcool" wrote:

that's the code I use too...
and I take it so does the rest as indeed there seems to be no other way.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

?B?Um9iZXJ0IENocmlzdGll?= wrote in message
:

Hi
Using Office Pro 2003 & WinXP

Is it possible to set the number of sheets when opening a new Workbook
without changing the default .SheetsInNewWorkbook of 3.

I was searching this newsgroup and came across the following in a Jim
Becker post of 17-Dec 2002.

Is this the only way to open a new workbook with a specific number of
sheets?

Code is courtesy of Ed Ferrero (12.02.02):

Dim curr_sheets As Integer
With Application
' save the no of sheets in new book that is currently set in options
curr_sheets = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 3
Workbooks.Add
.SheetsInNewWorkbook = curr_sheets
End With




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Open workbook with x number of sheets


but then again...
would you code specifically for xl2003?


i'm trying to shake the habit of making things xl97 compatible,
but you dont wanna know how many people and companies are still
using it.

And let's be honest, MS has made so few significant changes since xl97,
there's no real reason to upgrade..
BUT i'm hearing rumors that xl12 may (finally!) be a MAJOR overhaul.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Robert Christie wrote :

Thanks keepITcool

Jim Beckers post nearly 2 years old - thought maybe the newer 2003
excel may have included it.

Keep up the good work

Regards Bob C.

"keepITcool" wrote:

that's the code I use too...
and I take it so does the rest as indeed there seems to be no other
way.


--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam


?B?Um9iZXJ0IENocmlzdGll?= wrote in message
:

Hi
Using Office Pro 2003 & WinXP

Is it possible to set the number of sheets when opening a new
Workbook without changing the default .SheetsInNewWorkbook of 3.

I was searching this newsgroup and came across the following in a
Jim Becker post of 17-Dec 2002.

Is this the only way to open a new workbook with a specific
number of sheets?

Code is courtesy of Ed Ferrero (12.02.02):

Dim curr_sheets As Integer
With Application
' save the no of sheets in new book that is currently set in
options curr_sheets = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 3
Workbooks.Add
.SheetsInNewWorkbook = curr_sheets
End With




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Open workbook with x number of sheets

If you want one sheet in a workbook you can use a one liner.

Sub test()
Workbooks.Add (1)
End Sub

Or

Sub test2()
Workbooks.Add (xlWBATWorksheet)
End Sub





--
Regards Ron de Bruin
http://www.rondebruin.nl


"keepITcool" wrote in message ft.com...

but then again...
would you code specifically for xl2003?


i'm trying to shake the habit of making things xl97 compatible,
but you dont wanna know how many people and companies are still
using it.

And let's be honest, MS has made so few significant changes since xl97,
there's no real reason to upgrade..
BUT i'm hearing rumors that xl12 may (finally!) be a MAJOR overhaul.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Robert Christie wrote :

Thanks keepITcool

Jim Beckers post nearly 2 years old - thought maybe the newer 2003
excel may have included it.

Keep up the good work

Regards Bob C.

"keepITcool" wrote:

that's the code I use too...
and I take it so does the rest as indeed there seems to be no other
way.


--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam

?B?Um9iZXJ0IENocmlzdGll?= wrote in message
:

Hi
Using Office Pro 2003 & WinXP

Is it possible to set the number of sheets when opening a new
Workbook without changing the default .SheetsInNewWorkbook of 3.

I was searching this newsgroup and came across the following in a
Jim Becker post of 17-Dec 2002.

Is this the only way to open a new workbook with a specific
number of sheets?

Code is courtesy of Ed Ferrero (12.02.02):

Dim curr_sheets As Integer
With Application
' save the no of sheets in new book that is currently set in
options curr_sheets = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 3
Workbooks.Add
.SheetsInNewWorkbook = curr_sheets
End With








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open and copy all workbook sheets in a folder to a master file [email protected] Excel Discussion (Misc queries) 0 November 2nd 06 04:29 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
max number of sheets possible in a workbook? Boon8888 Excel Discussion (Misc queries) 2 February 2nd 06 06:20 PM
Workbook and sheets have disappeared but file can open Jacktion Excel Discussion (Misc queries) 4 January 27th 05 02:11 PM
Return the number of Sheets in a Workbook gminor7[_3_] Excel Programming 3 November 17th 03 11:02 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"