Excel Macro gives run time error 9 on some computers but not

movement3

New Member
Joined
Oct 21, 2002
Messages
1
Hello,

I have written a macro that takes user inputted information in Worksheet named “Start” and create a form in another worksheet (“Data Capture”) within the same workbook. I am confused because the VB code runs perfectly on my computer, my laptop, and several other computers, ranging from Office 2000 and Office XP. However on some specific computers, the macro receives run-time error 9 subscript out of range. The yellow highlighted code when I try to debug it is:

student_name = Workbooks("master_template").Worksheets("Start").Range("C9").Value

I have search all around, but most of the comments regard issues with diming arrays. Why would the script work as desired on some computers but not other computers? I have posted the code for the sub giving me this error. Any insight or advice would be greatly appreciated. Oh yes, I’m quite aware my code is horribly inefficient but I just started writing Excel macros and VB last week, so project two is make the code leaner, but right now I just want it to work!

Link to macro code


Thank you very much.
This message was edited by movement3 on 2002-10-22 04:23
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi,

You will get the "run-time error 9 subscript out of range" message if the sheet name in the workbook does not match EXACTLY the sheet name referred to in the macro. Check that the word "Start" is spelled correctly in the worksheet tab in all machines, and that there are no leading spaces before or after the word e.g. as far as the macro is concerned, "Start" is not the same as " Start" (note the leading space).

Incidentally, I successfully ran your code in Excel 97 - SR2.


Regards,


Mike
 
Upvote 0

Forum statistics

Threads
1,203,461
Messages
6,055,559
Members
444,798
Latest member
PAO1609

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
Back
Top