Calling a Macro in a WS

EE Pros,

I have a very sophisticated Workbook with a number of Macros.  Here's my question:

I want to "call" a macro that's in a particular WS to support another Macro.  So, for example;

Sub Clearall()
ClearSub1
ClearSub2
ClearSub3
ClearSub4
End Sub

So here's the problem.  The first 3 Subs are in Modules and accessable to the ClearAll sub.  They work fine.  The 4th Sub (ClearSub4), is in a specific Sheet (Sheet 18).  How do I add a statement so that the major Sub (ClearAll) recognizes the ClearSub4 routine?

B.
Bright01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

then try

Sub Clearall()
 ClearSub1
 ClearSub2
 ClearSub3
 Sheet18.ClearSub4
 End Sub

Open in new window

EDIT

or
Sheets("Sheet 18").ClearSub4

Open in new window

Regards
Bright01Author Commented:
I tried both.  I get a Run-Time error '9';  Subscript out of range.

Any ideas?  The Macro runs properly within the Worksheet (Sheet18); just not from another Worksheet, referencing the Sub that's in the Worksheet.....

Any ideas to troubleshoot?

B.
Rgonzo1971Commented:
is Sheet18 the code or the name of the sheet
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Bright01Author Commented:
Rgonzo,

It's

Sheet18 (IT_Assets)

Actually.

B.
Rgonzo1971Commented:
Which error with this

Sheets("IT_Assets").ClearSub4
Bright01Author Commented:
Ok changed it.   Now getting a Run-time error 6:  Overflow

B.
Rgonzo1971Commented:
Could you send a dummy?
Martin LissOlder than dirtCommented:
Two solutions.

1) Move ClearSub4 to a module and make it Public.

2) It would probably work even if you didn't move it and just made it Public, but 1) is better.
Bright01Author Commented:
How do I make it "public"?

B
Martin LissOlder than dirtCommented:
If the Sub's declaraton line looks like this Sub test() or this Private Sub test(), change it to

Public Sub test()

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bright01Author Commented:
Thanks guys.... sorry for the delay.  I had to play with it a while to get it to work.  Problem on my end, not yours.  Both answers were very good... in the end, I went with Martin's recommendation.

Great Teamwork to both of you!

B.
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest youincluding these two new ones.
An Experts Exchange Shortcut for the Truly Lazy (for Apple OS X)
A Guide to Writing Understandable and Maintainable VBA Code
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.