Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Functionプロシージャ例2
Sub MainSub()
'引数を受け取らないでFunctionプロシージャを呼び出す
TestFunc 4, 10
End Sub
Function TestFunc(a As Integer, b As Integer)
Dim result As Integer
result = a + b
'引数を受け取らないので、ここでExcelに出力を行う
Sheets("Sheet1").Cells(1, 1) = result
'Functionプロシージャ名に対して戻り値を代入
TestFunc = result
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment