LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default subscript out of range

Hello,

I have a script I have been running which has suddenly run into a
"Runtime error '9' - subscript out of range" error.

The original code had this:
Selection.Copy
ActiveWindow.ActivateNext
Sheets("Spending").Select

And I changed it a while ago to this:
Selection.Copy
Windows("finances_2009.xlsx").Activate
Sheets("Spending").Select

And eventually to this:
Selection.Copy
Windows("finances_" + Right(Str(Year(Date)), 4) + ".xlsx").Activate
Sheets("Spending").Select

Only the top version now works. And the later 2 do not giving me the
subscript error. Any ideas how I can fix this?

Thanks,
Ben
 
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
Subscript out of Range Steve Excel Discussion (Misc queries) 3 April 15th 09 04:01 PM
Subscript out of range? Dave Birley Excel Programming 5 May 31st 07 03:14 PM
Subscript Out of Range Al Excel Programming 5 September 22nd 04 07:07 PM
Subscript out of range Bill Murphy Excel Programming 1 August 5th 04 08:52 AM
subscript out of range Todd Huttenstine[_3_] Excel Programming 1 June 11th 04 04:08 AM


All times are GMT +1. The time now is 09:39 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"