Post #12 of this link addresses running macros to generate code and I use it quite a bit. Follow the steps and do the changes you want to a spreadsheet. The code that is generated will be very close but it is still VBA. From that point you can tweak it the way you need.

http://www.vbforums.com/showthread.php?t=391665