---
title: Calling a Sub from a Sub in VBA
description: Calling a Sub from a Sub in VBA
---

[Skip to content](https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba#main-content)

![Conny-Söderholm](https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg)

- [Home](https://www.connysoderholm.com/)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)

Open main navigation

Close main navigation

- [Home](https://www.connysoderholm.com/)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)

 June 18, 2018

# Calling a Sub from a Sub in VBA

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba) [Twitter icon](https://twitter.com/intent/tweet?url=https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba) [envelope icon](mailto:?body=https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba)

*Calling a Sub from a Sub in VBA* - When you are creating macros you sometimes want to run other functions or subs from your VBA code. One clarification about what a subroutine is: It is a function that does not return anything, or in other words a macro. In this post, we are going to cover how to call a subroutine from another.

In the last [post](https://connysoderholm.com/vba-worksheet-change-event/) about the Worksheet.Change event, we covered how to catch a change event. We showed a MsgBox and did some changing of values. We could easily have called a subroutine as well. Let's call one from a button.

```
Sub Our_sub_button()
    I_like_to_be_called
End Sub
```

Sub I\_like\_to\_be\_called()  
MsgBox "Hi, nice to be called!"  
End Sub

First, we attach the "Our\_sub\_button" to a Form button. We then call the "I\_like\_to\_be\_called" subroutine from our button. Note that you do not need the Call keyword, but you can use it if you like as below:

```
Sub Our_sub_button()
    Call I_like_to_be_called
End Sub
```

Sub I\_like\_to\_be\_called()  
MsgBox "Hi, nice to be called!"  
End Sub

This is all good Conny, but I want to pass variables also. How do I do that? See below. You just put the variables after the call, omitting the parentheses since we are not using the Call keyword. You also need to create the variables in your subroutine that you are calling.

```
Sub Our_sub_button()
    I_like_to_be_called "this is ", "my message"
End Sub
```

Sub I\_like\_to\_be\_called(MSG As String, MSG2 As String)  
MsgBox (MSG + MSG2)  
End Sub

Now you know how to call a subroutine. Happy coding!

[Excel](https://www.connysoderholm.com/blog/tag/excel)

## Related posts

[Python](https://www.connysoderholm.com/blog/tag/python)

## [Playing Super Mario theme music with Python](https://www.connysoderholm.com/blog/playing-super-mario-theme-music-with-python)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 June 27, 2018

Playing Super Mario theme music with Python - Are you a music composer that likes the sound from...

[Read more](https://www.connysoderholm.com/blog/playing-super-mario-theme-music-with-python)

## [How to refine your Google search; Common search techniques](https://www.connysoderholm.com/blog/how-to-refine-your-google-search-common-search-techniques)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 July 11, 2018

How to refine your Google search; Common search techniques Why do you need to improve your Google...

[Read more](https://www.connysoderholm.com/blog/how-to-refine-your-google-search-common-search-techniques)

[Python](https://www.connysoderholm.com/blog/tag/python), [pypdf2](https://www.connysoderholm.com/blog/tag/pypdf2)

## [Splitting a pdf to single pages with PyPDF2](https://www.connysoderholm.com/blog/splitting-a-pdf-to-single-pages-with-pypdf2)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 December 13, 2019

Splitting Pdfs with Python In this post, we are going to have a look at how to split all pages from...

[Read more](https://www.connysoderholm.com/blog/splitting-a-pdf-to-single-pages-with-pypdf2)

[linkedin-in icon](https://www.linkedin.com/in/connysoderholm) [Follow us on Facebook](https://www.youtube.com/@connysoderholm1473)

- [Home](https://www.connysoderholm.com)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)
- [Privacy Policy](https://www.connysoderholm.com/privacy-policy)
- [Disclaimer](https://www.connysoderholm.com/disclaimer)

---

[![Conny Söderholm Logo](https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg "Conny Söderholm Logo")](http://Conny%20Söderholm)

Copyright © 2026 Conny Söderholm

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Conny Söderholm",
    "url" : "https://www.connysoderholm.com/blog/author/conny-soderholm"
  },
  "dateModified" : "2023-07-31T14:48:42.828Z",
  "datePublished" : "2018-06-18T16:03:44.000Z",
  "headline" : "Calling a Sub from a Sub in VBA",
  "mainEntityOfPage" : {
    "@id" : "https://www.connysoderholm.com/blog/calling-a-sub-from-a-sub-in-vba",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg"
    },
    "name" : "Conny Söderholm"
  }
}
```