subscript out of range

Mr. McDuffee

New Member
Joined
Aug 31, 2006
Messages
7
All -

I have a user at a remote location that keeps getting this message when printing a spreadsheet that he has been using for the past couple of years. Microsoft Visual Basic error that states Run time error '9', subscript out of range. It then gives him the option to continue, end, debug, and help, but only End is active.

The only problem is that I am not sure how to look at the code, or decipher the code. I am not sure who developed the workbook, and neither is he.

Can anyone give me guidance on what to look for and possibly telling me how to view the code so I can have someone look it over.

Thanks in advance,

Mr. McDuffee

P.S. Sorry if this has been addressed other areas. If it has, can you please direct me to where I can find the info.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

DauntingGecko

Well-known Member
Joined
Feb 2, 2006
Messages
521
In English this error means something that was in the workbook is now missing (or that something has had its named changed so it can't find it) - hence the code can't complete.

We won't know what this is, unless we look at the whole workbook. Do you have an IT department who can look at this for you?

To look at the code hold down "ALT + F11" (or click on debug when the error message appears).

Post part of the code that is highlighted by the debugger and we can see what it is that is missing...
 

Mr. McDuffee

New Member
Joined
Aug 31, 2006
Messages
7
I am part of the IT department. I am working on this for a user at a remote location. I just don't have any trainging in VB, and I thought this would be good experience. I am not actually supposed to work on VB errors, since they are the ones who created the worksheet, they are supposed to maintain them, but I like a new challenge.

Thanks for the advice. I will take a look at the code. As for running debug, the user cannot select debug, he can only chose end.

Thanks again, I will post the code when I get the file.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Mr. McDuffee

Do you have any idea how this code is being run?

Is it from a userform?

If it is, that's could be one reason why the user can't select Debug.
 

Mr. McDuffee

New Member
Joined
Aug 31, 2006
Messages
7

ADVERTISEMENT

Once again, I am very new to all this, so I am not sure. I believe it is. How can I tell?
 

DauntingGecko

Well-known Member
Joined
Feb 2, 2006
Messages
521
Userform = form / GUI.

It could well be that the VBA code is password protected - so you won't be able to see the code. :confused:
 

Mr. McDuffee

New Member
Joined
Aug 31, 2006
Messages
7
Most likely it is userform. I will have to contact the user. He should be in now (two hour delay).

Edit - Alas it is password protected. Guess I will have to crack it since the creator resigned from the company three years ago.
 

Forum statistics

Threads
1,136,369
Messages
5,675,360
Members
419,565
Latest member
Phil57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top