Populate range with random numbers and calculate the avg and sum

PHOTO EMBED

Sun Nov 14 2021 08:49:44 GMT+0000 (Coordinated Universal Time)

Saved by @IsabellaLM #vba

Sub populaterange()

Dim myrange As range

Set myrange = range("C2:J12")
myrange.Value = "=rand()"

range("C14").Value = "Average"
range("D14").Formula = WorksheetFunction.Average(myrange)

range("C15").Value = "Sum"
range("D15").Formula = WorksheetFunction.Sum(myrange)

End Sub
content_copyCOPY