Macros do just about anything you can do in Excel manually, except automated. More complex macros can perform repetitive tasks, do complex calculations, operate other Office programs and access Windows API. You can create new files, open existing files, search for files, write output to text files... you name it. Think of them as Visual Basic programs, embedded in your Excel workbooks.
For an example, go to Tools->Macros->New Macro and begin recording. Do something in Excel (anything, for simplicity enter data), then click Stop recording. After that, from Excel press Alt+F8 to run the macro. Go to VBE (Alt+F11) to see the Visual Basic code that Excel generated.