I think it has less to do with the worksheet function and more to do with your use of Selection. Remove this one and see how it works. Outside a few scenario's you really shouldnt be using selection.

Selection.Cells((SelectionRows - 1), 9).Value = Application.WorksheetFunction.Average(Selection.Range(Cells(1, 9), Cells((SelectionRows - 1), 9)))