#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Macros warning always shows up, even if all macros removed Joe M Excel Discussion (Misc queries) 1 December 20th 07 04:45 AM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
Parametrized Macros preventing other macros sundar Excel Programming 1 August 18th 03 02:06 PM
List the Macros that can be executed from Tools-Macros Rob Bovey Excel Programming 1 July 10th 03 05:34 PM


All times are GMT +1. The time now is 04:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"