Code:
Dim sum As Long, n As Integer
sum = (2 * n + 1) * (n + 1) * n / 6
Had to think about that one a bit more...

John