Hi,
The way to build a macro is to decide exactly what you want to do by hand. Then turn on the macro recorder and record the steps to accomplish what you want. Turn off the macro record and go look at the VBA code that was produced. From there you can see what basic VBA commands are used to accomplish what you want. Next you might need to modify the code so it works with different sizes of data or copies to the end, instead of over cells you need.
Here is a good site to read:
http://www.excel-vba.com/excel-vba-contents.htm
Bookmarks