VBA code Required to Run the Multiple VBA Codes

  • Thread starter Thread starter MS-Exl-Learner
  • Start date Start date
M

MS-Exl-Learner

Hi,

I am having 3 VBA Codings, 2 VBA codings are written in Module and the last
vba coding is written in THIS WORKBOOK. The 3 VBA Coding Names are

VBA Coding Names
FIRS_T
SECON_D
THIR_D

Now I want to write another coding in VBA to run that three vba codes. If I
run this new coding then it should run the above three VBA codes.

I don’t know how to do it. Pls Suggest.
 
I am getting the below mentioned error message

Compile Error:
Sub or Function not defined

Please guide me.

--------------------
(MS-Exl-Learner)
--------------------



Robert Flanagan said:
Sub RunAll
FIRS_T
SECON_D
THIR_D
end Sub

Robert Flanagan
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
Try the below

Sub RunAll()
FIRS_T
Secon_d
ThisWorkbook.Thir_d
End Sub


If this post helps click Yes
---------------
Jacob Skaria


MS-Exl-Learner said:
I am getting the below mentioned error message

Compile Error:
Sub or Function not defined

Please guide me.
 
Thank you it's working fine.

But now the VBA codes are Starting with Sub function only. If it is in Sub
Function then its working fine. But if i change the 3 VBA Macros as Private
Sub then it's showing the below error message.

Compile Error:
Method or data member not found

Thank you,
 
If you declare a procedure (Sub, Function, or Property, it doesn't
matter) as Private, it can only be used by code within the module in
which is resides. You cannot call a Private procedure from outside the
module. You should never have two Public procedures with the same name
in separate modules -- e.g., Modules1 and Module2 both have a Sub
named "ABC").

If you need to access procedures that reside in other modules, those
procedures should be scoped as Public or Friend.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Thanks for your reply.

I am not familiar with Macro codes, but in my Work book if I press ALT+F8
it's showing that three Macros and Newly added RUNALL Macro. I just want to
hide that 3 Macros and people should able to view only the RUNALL whenever
they press ALT+F8.
 
Back
Top