Welcome to the Forums.

Could you be a little more descriptive of what your trying to do?

For the most part, you can record a macro doing the action you want to
program. Then when your done, stop recording and check the code
generated in the Module in the VBA IDE.