Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros
How do I create a link to a worksheet using macros? I recorded a macro
while typing in a worksheet, then inserted another worksheet and placed an object to assign it with an existing macro. I got a warning that says, Run-time error '9': Subscript out of range. Can someone please teach me how to fix this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros
The error message implies that you referenced a
nonexistent member of a collection. In other words, you have a reference in your code to a worksheet, shape object, element in an array or other member of a collection that does not exist. Most often, this results from an invalid reference to the object. You need to look at all references to objects, in particular worksheets and shape objects to ensure that their referencing is valid. I'm going to guess that you selected a shape object (command button, chart, rectangle etc.) on the worksheet and your recorded code reflected this as "ActiveSheet.Shapes("CommandButton1").Select" or something similar. If you run the code from another worksheet then it becomes the active sheet and there is probably no "CommandButton1" on this sheet. If you have difficulty resolving the problem, post your code and we should be able to fix it. Regards, Greg -----Original Message----- How do I create a link to a worksheet using macros? I recorded a macro while typing in a worksheet, then inserted another worksheet and placed an object to assign it with an existing macro. I got a warning that says, Run-time error '9': Subscript out of range. Can someone please teach me how to fix this? . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros
Greg,
Thanks so much for the reply. I have already fixed it. :) Marij -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
Macros warning always shows up, even if all macros removed | Excel Discussion (Misc queries) | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions | |||
Parametrized Macros preventing other macros | Excel Programming | |||
List the Macros that can be executed from Tools-Macros | Excel Programming |