Return number from function : Function Return « Language Basics « VBA / Excel / Access / Word






Return number from function

 
Function NumOfDays()
   NumOfDays = 7
End Function
      
Sub DaysInAWeek()
    MsgBox "There are " & NumOfDays & " days in a week."
End Sub

 








Related examples in the same category

1.return value from user-defined function
2.Specifying the Data Type for a Function's Result
3.Passing Parameters and Returning Values
4.Return a string from funtion
5.Functions That Return an Array
6.Returning a sorted list