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