run-time error '9' subscript out of range microsoft 2007 excel

I am using Microsoft Excel 2007.


I get the Run Time Error '9' Subscript out of range : When running the macro that I have created.


I do not have any fancy c++ or c# coding. I am simply using the developers tab menu and recording a macro that registers all my movements (button clicks).

The MACRO simply formats an existing excel document in a way that I want to have it in.


I have this MACRO already set-up on several other computers for the business in different locations (cities) and I do not have this problem.


I am only experiencing this problem on this specific work station.


Could anyone help me solve this problem?






Question Info

Last updated September 11, 2019 Views 14,128 Applies to:

Generally, subscript out of range in a recorded macro would be indicative of trying to refer to a non-existent sheet.  Possibly a sheet that existed when the recording was made had a name change - perhaps accidentially.  the code might say




but the current name of Sheet1 might actually be  "Sheet1 "  with an added space someplace in the name.  These type problems are hard to detect - so you will need to look carefully.




Tom Ogilvy


Tom Ogilvy

26 people were helped by this reply


Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.