VBA 引数定義

・plSampleから、plプロシージャを呼び出し

・vbCrLf => 改行

Sub plSample()
Call pl("Excel", 5)
End Sub

------

Sub pl(msg As String, n As Long)

Dim i As Long, buf As String
For i = 1 To n
buf = buf & msg & vbCrLf 'vbCrLf => 改行
Next
MsgBox buf

End Sub