Did a macro you built disappear after saving?
If you built a macro, saved normally, and then reopened the file to find the macro gone, it was very likely saved in the standard .xlsx format. Macros only survive when the file is saved specifically as .xlsm.
Also worth checking: recording a macro in the first place
Alongside saving in the right format, learning how to record a macro to automate repetitive tasks can meaningfully speed up everyday spreadsheet work.
Frequently Asked Questions
Can I recover the macro from a file already saved as .xlsx?
Unfortunately not β the macro code is stripped out the moment a file is saved as .xlsx, so it is important to save any macro-containing file as .xlsm from the start.
Why do I get a security warning when opening an .xlsm file?
Because macros can run commands automatically, which carries some security risk, Excel shows a warning by default asking you to confirm the file comes from a source you trust.