Create a macro function to write registry values.