Skip to content

Instantly share code, notes, and snippets.

@milk19873
Last active September 20, 2017 12:34
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/1a89a5ef30e2c07415eb7f0736cb6934 to your computer and use it in GitHub Desktop.
Save milk19873/1a89a5ef30e2c07415eb7f0736cb6934 to your computer and use it in GitHub Desktop.
Functionプロシージャ例1
Sub MainSub()
'Functionプロシージャの戻り値を、「A1」セルに代入
Sheets("Sheet1").Cells(1, 1) = TestFunc(4, 8)
End Sub
Function TestFunc(a As Integer, b As Integer)
Dim result As Integer
result = a + b
'Functionプロシージャ名に対して戻り値を代入
TestFunc = result
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment