LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Is This A Bug????

Although I would use Worksheets rather than Sheets as Gary did, that code
worked fine for me adding 20 worksheets.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"EA" wrote in message
...
TradeWB.Sheets.Add After:=Worksheets(TradeWB.Sheets.Count)


I am adding worksheets to a WB using the above line. All I want to do is
add a new wks after the last wks in the book.

The line of code work for the first 16 iterations but causes a [Run-time
error '9' Subscript out of range] error on the 17th iteration.

The only way I can get the line to work after adding 16 worksheets is to

us
a :

TradeWB.activate statement before the above line of code.

I know this is a workaround, but is this a bug?

Can anyone tell me a way of adding worksheets, after the last current
worksheet without having to activate the workbook?

EA




 
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



All times are GMT +1. The time now is 03:52 PM.

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"