VBA Programming Series...14 - IT Skills

This blog is for IT lovers, accounts and finance executives who want to add value in their professional life.

test

Welcome to our blog. This blog is for IT lovers, Accounts/Finance Executives who wants to add value in their career path.

Search This Blog

Thursday, 24 May 2018

VBA Programming Series...14

test

Executing the procedure from another procedure


You can also execute a procedure from another procedure. Follow these steps if you want to give this a try:

1. Activate the VBA module that holds the CubeRoot routine.

2. Enter this new procedure (either above or below CubeRoot code — it makes no difference):


Sub NewSub()
Call CubeRoot
End Sub

3. Execute the NewSub macro.

The easiest way to do this is to move the cursor anywhere within the NewSub code and press F5. Notice that this NewSub procedure simply executes the CubeRoot procedure.

By the way, the keyword Call is optional. The statement can consist of only the Sub procedure’s name. I find, however, that using the Call keyword makes it perfectly clear that a procedure is being called.

No comments:

Post a Comment

Popular

Welcome to our blog. If you want to; learn writing skills, preparation for CSS/Corporate laws, IT skills, downloading Business/IT books, and many more; this blog is for you.