Hi Everyone
I have a routine in Excel 2007 in the 'Sheet1' object. This routine calls another routine "Sub NotifyIT()" which is in the stored in the 'ThisWorkbook' object.
I am getting a compile error "Sub or Function not Defined" at this line of my code:
Call NotifyIT
The "NotifyIT" routine can be called by both the routine in Sheet1 or by the BeforePrint event. Is there a way both can call the NotifyIT routine without me having two copy it to both objects?
Thanks!
HappyHole
Hi HappyHole,
You need to read this from the first sentence. It speaks to your problem
http://www.cpearson.com/excel/codemods.htm
One test is worth a thousand opinions.
Click the * below to say thanks.
Thanks Marvin, that is helpful.
The original routine controls lots of shapes and objects on Sheet1. I can move the code into a Standard Code Module but presumably then need to add sheet name references to all the instances of code that refer to an object sitting in sheet one right?
Thanks.
HH
You can use ActiveSheet in a Module and it will simply work on the one that is being viewed.
It all depends on your code....
One test is worth a thousand opinions.
Click the * below to say thanks.
More to the point, move NotifyIT to a normal module. You can then call it from the Sheet1 code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks