Macros can be complex.
I recommend that you start with Tools, Macros, Record New Macro. Then do manually the procedure that you want to be automated. Turn the recording off.
Then you can review and edit the macro by selecting Tools, Macros, Macros. Select the macro that you just recorded and select edit.
Use the help within the visual Basic editor.
Good luck,
Deb