'How to calculate average of data in vba

how to get average data using VBA Script.

example

   Dim Data  As Double
   Dim Data2 As Double
   Dim Data3 As Double

   Data = 15.66   // how to get Data = 16
   Data2 = 9.01   // how to get Data2 = 9
   Data3 = 45     // how to get Data3 = 45


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source