Hi,

a function returns a value. I don't see anything returning from "changefieldnames". If it doesn't return anything you should make it a sub.

 
Sub changefieldsnames(...