LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
EA EA is offline
external usenet poster
 
Posts: 28
Default Is This A Bug????

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 06:38 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"