Can someone help me out with a stored procedure

I have a grid view of spots that should hold information including
Category, Program, Program Type

I have another list view that has all this information and I use a place function to place this information in my empty spots in the grid. The way this is done is I select the spot in grid, select spot in list view and run my place function
I am trying to write code so I can count all the spots in grid and place the required spots from list view in one shot.

Thank you