9: Subscript out of range

J

jenz21985

Wonder if any one can help.

I know very little about excell & macros & I have been given
spreadsheet to update which just happens to be full of them.

At present I have one worksheet called MR600. In that I have
Month/year button which i press & the whole spreadsheet updates wit
new dates etc.

The thing is I need to have 30 of the same worksheets all wit
different names but as soon as I rename the worksheet & try to click o
Month I get an error - 9: Subscript out of range.

Can anyone tell me what Im doing wrong or what & where & how I woul
update it to work?

Thanks
:confused
 
D

Dave O

I've seen that message occur when a program expects a number to be
within a certain range but the number is outside that range because of
user inputs or something. Do you mind posting the code? It will be
easier to troubleshoot.
 
D

Dave Peterson

Subscript out of range will mean that your code is looking for something that
doesn't belong to that collection.

For instance, if you have code that looks like:

dim wks as worksheet
set wks = worksheets("sheet1")

If you don't have a worksheet named Sheet1, then you'll get this error. It
could be a simple misspelling or something worse.
 
D

Dave O

Right-click on the Month/Year button, click Assign Macro, click Edit.
The VBA editor will appear, and the code associated with the Month/Year
button will be showing: please copy everything from the word Sub to the
words End Sub (inclusive), and post it. Review it first, of course, to
make sure it does not somehow divulge sensitive information.
 
J

jenz21985

When I click on tools, maro, macros it just comes up with an empty box
asking me to type in the macro name.

I cannot right click on the month/year button.

Any other suggestions

:confused:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top