How to store the value into excel sheet like "Triangular" format

Manually enter one integer value at the run-time, the entered value should store into excel sheet like “Triangular” format

Kindly give any suggestion