VBA MOD01 Passing Arguments to sub procedures (ByRef , By Val)
Private Sub myCalc(Getvalue As Double, myPercent) Getvalue = Getvalue * myPercent MsgBox Getvalue End Sub Public Sub GetMyValue() Dim myValue As Double Dim p As Variant 'assign value and percentage from cell myValue = Range("A8").Value p = Range("B8").Value Call myCalc(myValue, p) MsgBox myValue End Sub ========================================================================= Private Sub myCalc(Getvalue As Double, myPercent) Getvalue = Getvalue * myPercent MsgBox Getvalue End Sub Public Sub GetMyValue() Dim myValue As Double Dim p As Variant 'assign value and percentage from cell myValue = Range("A8").Value p = Range("B8").Value If Excel.WorksheetF...