Skip to content

Instantly share code, notes, and snippets.

@milk19873
Created September 20, 2017 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milk19873/fc6e961e5700ea0958e1848279882da4 to your computer and use it in GitHub Desktop.
Save milk19873/fc6e961e5700ea0958e1848279882da4 to your computer and use it in GitHub Desktop.
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