This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub DoWork() | |
Dim name As String | |
name = "John" | |
Call PrintName(name) | |
Debug.Print "DoWork: " & name | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub DoWork() | |
Dim name As String | |
name = "John" | |
Call PrintName(name) | |
Debug.Print "DoWork: " & name | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub DoWork() | |
Dim name As String | |
name = "John" | |
Call PrintName(name) | |
Debug.Print "DoWork: " & name | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub MyPublicSub() | |
Call MyPrivateSub("John", 28) | |
MyPrivateSub "John", 28 | |
End Sub | |
Private Sub MyPrivateSub(name As String, age As Long) | |
Debug.Print name + " is " & age & " years old." | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub MyPublicSub() | |
Call MyPrivateSub ' use the Call keyword | |
MyPrivateSub ' just call the sub procedure | |
End Sub | |
Private Sub MyPrivateSub() | |
Debug.Print "In MyPrivateSub" | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' In Module1 | |
Option Explicit | |
Public Sub MyPublicSub() | |
Call Module2PrivateSub | |
End Sub | |
' --------------------- | |
' In Module2 | |
Option Explicit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub MyPublicSub() | |
Call DoSomeWork | |
Call MyPrivateSub | |
End Sub | |
Private Sub DoSomeWork() | |
Debug.Print "Work work work work work" | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' In Module1 | |
Option Explicit | |
Public Sub Module1Test() | |
Call Module2Test | |
End Sub | |
' ---------------- | |
' In Module2 | |
Option Explicit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Public Sub Procedure | |
Public Sub TestSub() | |
' code goes here | |
End Sub | |
' Private Sub Procedure | |
Private Sub TestSub() | |
' code goes here | |
End Sub |