Share this article

Improve this guide

Runtime Error 9: Subscript Out of Range [Fix]

Repair your workbook for any unforeseen errors

4 min. read

Updated onOctober 4, 2023

updated onOctober 4, 2023

Share this article

Improve this guide

Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more

Key notes

If you use a VBA code in your workbook and get a runtime error 9: Subscript out of range, you are trying to reference an object not present in the current context in yourMicrosoft Excelworkbook.

You’ll most likely run into this error when copying data between workbooks, so this is a reason to pay close attention to ensure you’re copying the right thing. Nonetheless, since the error has already occurred, here’s a quick-fix guide.

What is subscript error 9 in Excel?

What is subscript error 9 in Excel?

When you receive the runtime error 9, you are trying to access a cell or range of cells through a subscript that is outside the range of cells defined in your formula.

In other words, you’re trying to get to a place in the worksheet that doesn’t exist. This can happen because of one or more of the following reasons:

How do I fix Runtime error 9 subscript out of range?

How do I fix Runtime error 9 subscript out of range?

Try the following basic checks before any advanced troubleshooting:

1. Save the file in the Excel macro-enabled format

Macros are programs that are designed to automate tasks in Microsoft Office applications. When you run a macro, it will execute the actions that have been programmed into it.

However, the runtime error 9 may occur in Excel if you fail to save your file in the required format. XLSM files are used for storing macros and charts created using VBA in Excel.

This file type contains macros, which are programming instructions available to the user when they open the file and are required to work properly.

2. Enable macros

When you enable macros, you permit to run the macro in its current state. This means the macro can access all the formulas and functions it needs to run properly.

In its disabled state, only the basic functionality is available, and the user must enter data manually hence why copying between workbooks presents this runtime error 9 in Excel.

3. Repair Excel

In case this manual repair method fails to work, don’t fret. We have a list ofadvanced Excel repair toolsthat can easily do the job and repair a wide range of corruption issues.

And that’s a wrap for this article, but be sure to check out other related errors, such as theruntime error 7, and how to navigate such issues.

For any additional thoughts on this error, leave your comments down below.

More about the topics:Microsoft Excel,Runtime Errors

Claire Moraa

Windows Software Expert

Claire has a knack for solving problems and improving the quality of life for those around her. She’s driven by rationality, curiosity, and simplicity, and always eager to learn more about Microsoft’s products. With a background in teaching and reviewing, she breaks down complex topics into easily understandable articles, focusing mostly on Windows 11, errors, and software.

User forum

0 messages

Sort by:LatestOldestMost Votes

Comment*

Name*

Email*

Commenting as.Not you?

Save information for future comments

Comment

Δ

Claire Moraa

Windows Software Expert

With a background in teaching and reviewing, she breaks down complex topics into easily understandable articles, focusing mostly on Windows 11 errors.