Created
September 20, 2017 12:48
-
-
Save milk19873/fc6e961e5700ea0958e1848279882da4 to your computer and use it in GitHub Desktop.
Functionプロシージャ例2
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
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