Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2005, 08:18 AM
Authorized User
 
Join Date: Oct 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling procedures in other worksheets

How do you call a procedure that is stored in another worksheet of the same workbook?


 
Old July 20th, 2005, 08:24 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

in the procedure that is making the call put the following code...

Call Sheets(1).myModuleName

where 1 is the sheet index number and myModuleName is, you guessed it, the name of the module being called.

By prefixing the module name with the sheet in which it resides you are pointing the call to another object.

cheers

Matt
-----------------------------------------

 
Old July 20th, 2005, 08:28 AM
Authorized User
 
Join Date: Oct 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thats what I tried & didnt work, but just tried again and works OK. Must have made a typo originally!

Thanks again.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Worksheets brawny4 Excel VBA 2 December 29th, 2007 04:57 AM
Calling AS/400 Stored Procedures from VB.NET prasanthknair ADO.NET 0 January 19th, 2005 06:55 AM
Calling procedures from another excel file ja8261 Excel VBA 1 December 16th, 2004 11:26 AM
Calling Oracle Stored Procedures booksnore2 General .NET 0 August 24th, 2004 02:08 PM
Calling Stored procedures with out parameters bansalh Access 1 November 25th, 2003 04:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.