Skip to content

Instantly share code, notes, and snippets.

@ron623
Created August 2, 2018 06:33
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 ron623/c6251ee314e7a75f0be114804048b00f to your computer and use it in GitHub Desktop.
Save ron623/c6251ee314e7a75f0be114804048b00f to your computer and use it in GitHub Desktop.
★★★ 参照渡しの例 ★★★
Sub Sample_Ref()
Dim str As String
str = "もとの文字です(*`▽´*)"
' 参照渡しで関数を呼び出す
Call CallByRef(str)
' 上記の関数内で処理した文字列をメッセージボックスにて表示
MsgBox str
End Sub
' ★★★ 参照渡しの関数 ★★★
Sub CallByRef(ByRef msg As String)
End Sub
msg = "値を変えました!"
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment