Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Getting error "Subscript out of range" Runtime error "9"

  Asked By: Fabiana    Date: Feb 10    Category: MS Office    Views: 3374
  

Need your help to troubleshoot the following error

"Subscript out of range" Runtime error "9"..

I am getting this error, when I try to run a macro in excel

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Felix Gray     Answered On: Feb 10

I am also getting the same error  .............

 
Answer #2    Answered By: Sultana Tabassum     Answered On: Feb 10

Hopefully you're getting options to debug or end your execution.

If you click debug, it'll take you into the VB environment with the offending
line highlighted in yellow.

You can see the value of your local variables (which might be what you are using
as a subscript) in a pane at the bottom of the VBE window. Or if you hover the
mouse over the subscript, it should show you the value.

Another common way to get a subscript  out of range  is by referring to something
in a collection, with the wrong name for the item. E.g.

Sheets("A sheet")

will give this error  if there isn't a sheet called "A sheet".

If this doesn't help, you'll certainly need to post the code of your macro.
Also you'll need to indicate what's in any cells the macro  may be referring to.

 
Answer #3    Answered By: Hollie Hughes     Answered On: Feb 10

This is quite a common error  message. It's like you saying "pass me
the fifth book on the shelf" and me saying "but there are only four
books!"

If you want direct help  fixing it then you will need to post the your
code.

 
Didn't find what you were looking for? Find more on Getting error "Subscript out of range" Runtime error "9" Or get search suggestion and latest updates.




Tagged: