Sub AdjustANumber(ByRef a As Double) a = 42.42 End Sub Sub TestAdjustANumber() Dim a As Double a = 16.1 ' Here the debugger tells me a = 16.1. This is correct. AdjustANumber (a) ' Here the debugger tells me a = 16.1 but I expected a = 42.42 since it was passed by reference to the AdjustAnumber subroutine. MsgBox a ' This MsgBox displays 16.1 which is incorrect End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
23 Experts available now in Live!