tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
What's the difference between a function and the Get Property?
Both TestFunction and TestProperty generate the same results.
Thanks
Both TestFunction and TestProperty generate the same results.
Code:
Option Explicit
Sub TestFunction()
Dim d As Long
d = MyFunction(1, 2, 3)
End Sub
Sub TestProperty()
Dim d As Long
d = MyProperty(1, 2, 3)
End Sub
Function MyFunction(a, b, c) As Long
MyFunction = a + b + c
End Function
Property Get MyProperty(a, b, c) As Long
MyProperty = a + b + c
End Property
Thanks