If you are using Excel, there is a simple solution. Click on the cell with the name to select it. At the bottom right of the cell, notice the little box. Right-click the box and drag it down to the cell above the next named cell and release. Select, “Copy cells.”
This can be done with individual cells or with a range (vertical or horizontal) of cells.
It is way, way quicker than composing a macro.