Question: how to use byval in vba?
Answer: Open the Visual Basic Editor and click Insert, Module.
Add the following code lines: Function Triple(ByRef x As Integer) As Integer. x = x * 3. Triple = x. End Function. Result when you click the command button on the sheet:
Replace ByRef with ByVal.