Microsoft Office has a very useful tool for its Excel users known as Macros. This feature allows its users to automatically finish their mundane tasks that require repeated actions while working on an Excel workbook.
Sometimes, your carelessness may result in the accidental deletion of your important Macros from your Excel workbook. If that’s the case then do not be afraid.
I know some easy ways to recover your deleted Macros in Excel. Additionally, I will explain how you can repair your corrupted Excel workbook and get back your deleted Macros from it. So without further ado let’s begin.
Quick Links
- Brief Overview
- Where Can I Find My Deleted Macros?
- How To Recover Deleted Macros In Excel
- How To Enable Macros In MS Excel
- How To Repair Corrupted Excel Workbook
- Bonus Tips
- Can I Recover My Deleted Macros In Excel? Final Verdict
- FAQs
Brief Overview
Deleted Macros in Excel can be quickly recovered by importing the BAC file to your MS Excel’s VBA (Visual Basic For Applications). However, you will need to create a backup of your Macros beforehand on your PC. Or you can restore your Macros from your corrupted workbook using an Excel Repair software.
Where Can I Find My Deleted Macros?
According to Microsoft support, once you have deleted your Macros from your Excel workbook then you would never be able to get them back.
On the other hand, if you have saved and backed up your Macros in a .bac format then you can easily restore them on your Excel workbook from your PC’s File Explorer.
How To Recover Deleted Macros In Excel
The recovery of Excel Macros is impossible if you delete them directly from your Excel Workbook without creating a backup of your Macros. However, you can get back your deleted Macros on MS Excel if you have created a backup. To import your backed up Macros from your PC’s File Explorer to your workbook, follow the steps below:
1. First, open MS Excel on your PC and use the Alt+F11 Shortcut key to open Microsoft Visual Basic For Applications. After this, click on File and select Import File or use the Ctrl+M Shortcut key.
3. Then select the Macro file(s) you wish to recover and click on the Open button.
Finally, your deleted Macro will be restored on your Excel workbook.
In case, you have not created a backup for your deleted Excel Macros files then the only remaining option is to recreate your Macros from the start.
Recommended: How To Recover Deleted & Unsaved Excel Files
How To Enable Macros In MS Excel
Are you having trouble importing your Macros from your PC? If yes, then hurry up and follow the steps mentioned below:
1. First of all, open your MS Excel app and click on File.
2. Then select Options from the left navigation panel and a new window will open on your PC screen.
3. Now, go to the Trust Center and click on the Trust Center Settings… button.
4. After that, click on Macro Settings and select Enable all Macros.
5. Lastly, click on OK, and your Macro settings will be enabled.
How To Repair Corrupted Excel Workbook
If your workbook gets corrupted while working with Macros then Excel starts recovering your affected file automatically. However, when Excel repairs your corrupted Excel file, it doesn’t save your current data.
In case, you open your Excel workbook and find out that it has already been corrupted then you can recover it using an Excel Repair software. These tools allow you to repair or retrieve your corrupted Excel data including your Macros from the affected file.
However, this software may not be completely free and you could be asked to buy a subscription to get your corrupted Excel file repaired.
Here you can use Stellar Repair For Excel software and get back your corrupted Excel workbook and Macros by following the below steps:
1. First of all download and install the Stellar Excel Repair tool from their official site.
2. Close the MS Excel app before using the Excel File Repair Tool.
3. Now, launch Stellar Repair For Excel and click on the Select File option. Next, click on the Browse button.
4. After this, select the corrupted Excel file you want to repair and click on the Open button.
5. Next, click on the Repair Button and let it complete the repairing process.
6. Finally, select the Save File button and your Excel workbook will be repaired.
Note: The application may ask you for the Activation key which can be acquired by purchasing the subscription.
Use Macros On The Repaired Excel Workbook
Once your corrupted Excel file is repaired, open it in MS Excel and press the Alt+F8 shortcut key. After that, select the Macro you wish to use on your Worksheet and click on Run.
Bonus Tips
Here are some simple but crucial tips and tricks to save your Excel files as well as Macros from deletion.
Create A Backup Of Your Macros
Always save your important Macros on your PC’s File Explorer in Module.bas format. This way your Macros will be safe from accidental deletion and can be transferred to a different Excel workbook. You can easily create a backup by following the steps below.
1. Open your workbook and use the Alt+F11 shortcut key to access Microsoft Visual Basic For Applications.
2. Then select the Module option from the left navigation panel and double-click the Macro you want to save as backup.
3. After this, your Macro will be opened in VBA code on your PC screen.
4. Now, click on File and select the Export File option or you can use the Ctrl+E shortcut key.
5. Finally, Click on Save and your important Macro will be saved as a backup file on your PC.
Repair Corrupted Workbook
MS Excel has an inbuilt auto-repairing mechanism for your Excel files. However, this mechanism is ineffective against malware or virus attacks. In case, your workbook was corrupted due to a virus attack then you can use a 3rd party Excel repair tool to restore the affected Excel file.
Use Anti Virus Software
Anti-virus tools protect your device and your data from external threats such as viruses, malware, and unwanted advertisements.
Can I Recover My Deleted Macros In Excel? Final Verdict
Yes, the recovery of your deleted Macros is possible and I have explained how you can do this in easy steps. However, if you delete your Macros without creating backup files then bear in mind that you will never get them back.
After that, the only thing you can do is recreate your Excel Macros and practice the above-explained tips so that you do not lose your Macros again.
FAQs
How To Find Macros In Your Excel Workbook?
Your Macros are stored in your Excel workbook file that can easily be accessed by pressing the Alt+F8 short key.
How Do I Recover A Deleted Macro In Excel?
You can retrieve your deleted Macro in Excel if you have saved it on your PC in Module.bas format.
How Do You Check If Macros Are Enabled In Excel?
Just use the Alt+F8 shortcut key. If it is disabled then you will be informed by MS Excel automatically.