Sub or Function not defined compile error help
I am trying to learn and understand VBA. So I am trying to figure out how to pass a variable through as an argument. I found this example online. It shows how you could pass an argument from a Sub to a Private Sub but when I run it, all I get is a "Compile error: Sub or Function not defined" and I don't understand why I am getting this error. I copied it exactly as they had it.
The following code is what I assume is triggering the error message because "Call SecondCode is what is highlighted.
Code:
Call SecondCode(True, "Arial", 22)
The code below was written in module.
Code:
Sub FirstCode()
Dim FormatCell As Integer
FormatCell = ActiveCell.Value
If FormatCell < 20 Then
Call SecondCode(True, "Arial", 22)
End If
End Sub
This second code was written in ThisWorkbook
Code:
Option Explicit
Private Sub SecondCode(BoldValue As Boolean, NameValue As String, SizeValue)
With ActiveCell.Font
.Bold = BoldValue
.Name = NameValue
.Size = SizeValue
End With
End Sub
Thank you in advance for any help given.