Writing a macro in Excel in Google Docs?

Where does one start to learn how to write a macro in Excel in Google Docs? Are there tutorials out there somewhere?

Excel VBA macros are not compatible with Google Docs spreadsheets. Do you mean writing a macro in Google Apps Script for a Google Docs spreadsheet?

Yes, Google Apps Script.

Tutorials are here, documentation here, spreadsheet-specific functions here.