{"id":2859,"date":"2026-11-09T10:50:14","date_gmt":"2026-11-08T23:50:14","guid":{"rendered":"https:\/\/www.dynamicwebtraining.com.au\/blog\/?p=2859"},"modified":"2026-11-09T11:06:50","modified_gmt":"2026-11-09T00:06:50","slug":"what-is-a-macro-in-excel","status":"publish","type":"post","link":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel","title":{"rendered":"What Is a Macro in Excel? (And How to Record One)"},"content":{"rendered":"\n<p class=\"has-normal-font-size wp-block-paragraph\"><strong>A macro in Excel is a recorded series of actions, such as formatting a report or cleaning imported data, that Excel saves as VBA code and can replay whenever you need it. To create one, go to View > Macros > Record Macro, give it a name, carry out the steps once, then click Stop Recording. Run it again with Alt + F8, a keyboard shortcut or a button, and save the file as an Excel Macro-Enabled Workbook (.xlsm) so the macro is kept.<\/strong><\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">If you do the same Excel task every week, a macro can do it for you in seconds. You do not need to know any code to start: Excel&#8217;s macro recorder watches what you do and writes the code for you. This guide explains what macros are, how to record and run one, how to save it, and how to enable macros safely when Excel blocks them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"2f7cb2\" data-has-transparency=\"false\" style=\"--dominant-color: #2f7cb2;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A-1024x538.png\" alt=\"What is a macro in Excel and how to record one, a guide from Dynamic Web Training\" class=\"wp-image-2860 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A-1024x538.png 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A-300x158.png 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 id=\"h-what-is-a-macro-in-excel\" class=\"wp-block-heading has-h-4-font-size\">What is a macro in Excel?<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">A macro is a small program that repeats a set of steps for you. When you record a macro, Excel notes every action you take (selecting cells, typing, formatting, sorting, inserting columns) and stores it as code in VBA (Visual Basic for Applications), the programming language built into Microsoft Office. Running the macro replays those steps in the same order, usually far faster than you could do them by hand.<\/p>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Common uses include:<\/p>\n\n\n\n<ul class=\"wp-block-list has-normal-font-size\">\n<li><strong>Formatting reports<\/strong> the same way every time (fonts, column widths, number formats, headers)<\/li>\n\n\n\n<li><strong>Cleaning imported data<\/strong>, such as deleting blank rows, splitting columns or removing extra spaces<\/li>\n\n\n\n<li><strong>Repeating multi-step tasks<\/strong>, such as adding a total row, applying a filter and printing<\/li>\n\n\n\n<li><strong>Building the same summary<\/strong> from a new data export each week or month<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-how-do-you-record-a-macro-in-excel\" class=\"wp-block-heading has-h-4-font-size\">How do you record a macro in Excel?<\/h2>\n\n\n\n<ol class=\"wp-block-list has-normal-font-size\">\n<li>Go to the <strong>View<\/strong> tab, click the arrow under <strong>Macros<\/strong> and choose <strong>Record Macro<\/strong>. (If the Developer tab is showing, you can also use <strong>Developer > Record Macro<\/strong>.)<\/li>\n\n\n\n<li>Type a <strong>Macro name<\/strong>. It must start with a letter and cannot contain spaces, so use something like FormatSalesReport.<\/li>\n\n\n\n<li>Optionally add a <strong>Shortcut key<\/strong>. Type a capital letter so the shortcut becomes Ctrl + Shift + that letter, which avoids replacing built-in shortcuts such as Ctrl + C.<\/li>\n\n\n\n<li>Under <strong>Store macro in<\/strong>, choose <strong>This Workbook<\/strong>, or <strong>Personal Macro Workbook<\/strong> if you want the macro available in every workbook you open.<\/li>\n\n\n\n<li>Add a short description, then click <strong>OK<\/strong>. Excel is now recording.<\/li>\n\n\n\n<li>Carry out the task exactly as you want it repeated.<\/li>\n\n\n\n<li>Go to <strong>View > Macros > Stop Recording<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"f7f7f7\" data-has-transparency=\"false\" style=\"--dominant-color: #f7f7f7;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"574\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-1024x574.png\" alt=\"The Record Macro dialog box in Excel showing the macro name, shortcut key, Store macro in and description fields\" class=\"wp-image-2861 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-1024x574.png 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-300x168.png 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-1536x862.png 1536w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-2048x1149.png 2048w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-1200x673.png 1200w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-options-customize-ribbon-developer-tab-1-1980x1111.png 1980w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">View > Macros > Record Macro. Name the macro, choose where to store it, then click OK and do the task once.<\/figcaption><\/figure>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">By default, the recorder uses fixed cell addresses, so the macro always works on the same cells. If you want it to work from whichever cell is selected, turn on View &gt; Macros &gt; Use Relative References before you start recording.<\/p>\n\n\n\n<h2 id=\"h-how-do-you-run-a-macro-in-excel\" class=\"wp-block-heading has-h-4-font-size\">How do you run a macro in Excel?<\/h2>\n\n\n\n<ul class=\"wp-block-list has-normal-font-size\">\n<li><strong>Macro dialog box<\/strong>: press <strong>Alt + F8<\/strong> (or <strong>View > Macros > View Macros<\/strong>), select the macro and click <strong>Run<\/strong>.<\/li>\n\n\n\n<li><strong>Keyboard shortcut<\/strong>: press the shortcut you set when recording, such as Ctrl + Shift + R.<\/li>\n\n\n\n<li><strong>Button<\/strong>: insert a shape (<strong>Insert > Shapes<\/strong>), right-click it, choose <strong>Assign Macro<\/strong>, pick the macro and click <strong>OK<\/strong>. Clicking the shape now runs the macro.<\/li>\n\n\n\n<li><strong>Quick Access Toolbar<\/strong>: go to <strong>File > Options > Quick Access Toolbar<\/strong>, choose <strong>Macros<\/strong> from the list and add yours.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"f5f6f6\" data-has-transparency=\"false\" style=\"--dominant-color: #f5f6f6;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"557\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-1024x557.png\" alt=\"The Developer tab in Word with the Check Box Content Control button highlighted in the Controls group\" class=\"wp-image-2862 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-1024x557.png 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-300x163.png 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-1536x835.png 1536w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-2048x1114.png 2048w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-1200x653.png 1200w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-developer-tab-checkbox-content-control-1-1980x1077.png 1980w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Developer > Controls > Check Box Content Control inserts a box you can tick and untick.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One important difference from normal editing: you cannot undo a macro with Ctrl + Z. Save your workbook before running a macro for the first time, or test it on a copy.<\/p>\n\n\n\n<h2 id=\"h-how-do-you-save-a-workbook-with-macros\" class=\"wp-block-heading has-h-4-font-size\">How do you save a workbook with macros?<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">A standard .xlsx workbook cannot store macros. If you save a file with macros as .xlsx, Excel warns you and the macros are removed. Instead:<\/p>\n\n\n\n<ol class=\"wp-block-list has-normal-font-size\">\n<li>Go to <strong>File > Save As<\/strong>.<\/li>\n\n\n\n<li>In the file type list, choose <strong>Excel Macro-Enabled Workbook (*.xlsm)<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Macros stored in the Personal Macro Workbook are saved in a hidden file called PERSONAL.XLSB, which opens in the background whenever Excel starts. Excel asks whether to save it when you close Excel; click Save to keep your macros.<\/p>\n\n\n\n<h2 id=\"h-how-do-you-enable-macros-in-excel\" class=\"wp-block-heading has-h-4-font-size\">How do you enable macros in Excel?<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Excel disables macros by default because macros can carry malicious code. When you open a macro-enabled file, you will usually see one of two messages:<\/p>\n\n\n\n<ul class=\"wp-block-list has-normal-font-size\">\n<li><strong>A yellow Security Warning bar<\/strong> saying macros have been disabled. If you trust the file and where it came from, click <strong>Enable Content<\/strong>.<\/li>\n\n\n\n<li><strong>A red Security Risk bar<\/strong> saying Microsoft has blocked macros because the source of the file is untrusted. This appears for files downloaded from the internet or received by email. If you trust the file, close it, right-click it in File Explorer, choose <strong>Properties<\/strong>, tick <strong>Unblock<\/strong> on the General tab and click <strong>OK<\/strong>. Then open it again and click <strong>Enable Content<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"fafaf9\" data-has-transparency=\"false\" style=\"--dominant-color: #fafaf9;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"428\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-1024x428.png\" alt=\"The Content Control Properties dialog box in Word showing the Checked symbol and Unchecked symbol options\" class=\"wp-image-2863 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-1024x428.png 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-300x125.png 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-1536x642.png 1536w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-2048x856.png 2048w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-1200x502.png 1200w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/word-content-control-properties-checked-symbol-1-1980x828.png 1980w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Developer > Properties > Checked symbol > Change lets you replace the default X with a tick.<\/figcaption><\/figure>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">You can review the overall setting under <strong>File > Options > Trust Center > Trust Center Settings > Macro Settings<\/strong>. The default, <strong>Disable VBA macros with notification<\/strong>, is the safest everyday choice because it lets you decide file by file. Avoid <strong>Enable VBA macros<\/strong>, which runs any macro without asking. At work, your IT team may control these settings for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How do you see or edit the code behind a macro?<\/p>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Press <strong>Alt + F11<\/strong> to open the Visual Basic Editor, or select the macro in the Macro dialog box (Alt + F8) and click <strong>Edit<\/strong>. Recorded macros are stored in a module, and the code reads much like a list of instructions. A macro that bolds and colours a header row might look like this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Sub FormatHeader()\n    Range(\"A1:F1\").Font.Bold = True\n    Range(\"A1:F1\").Interior.Color = RGB(31, 56, 100)\n    Range(\"A1:F1\").Font.Color = RGB(255, 255, 255)\nEnd Sub<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">Sub FormatHeader()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    Range(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">A1:F1<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">).Font.Bold = True<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    Range(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">A1:F1<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">).Interior.Color = RGB(<\/span><span style=\"color: #B48EAD\">31<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #B48EAD\">56<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #B48EAD\">100<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    Range(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">A1:F1<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">).Font.Color = RGB(<\/span><span style=\"color: #B48EAD\">255<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #B48EAD\">255<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #B48EAD\">255<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">End Sub<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Small edits, such as changing a range or a colour, are a good way to start learning VBA. Writing your own code lets you add things the recorder cannot, such as loops, decisions and messages to the user.<\/p>\n\n\n\n<h2 id=\"h-what-is-the-difference-between-a-macro-and-vba\" class=\"wp-block-heading has-h-4-font-size\">What is the difference between a macro and VBA?<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">A macro is the automated task; VBA is the language the macro is written in. Recording a macro writes the VBA for you, which is ideal for simple, fixed steps. Writing VBA yourself lets you build macros that make decisions, repeat over every row or sheet, and handle data that changes size.<\/p>\n\n\n\n<h2 id=\"h-do-macros-work-in-excel-for-the-web-or-on-a-mac\" class=\"wp-block-heading has-h-4-font-size\">Do macros work in Excel for the web or on a Mac?<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Excel for Windows and Excel for Mac can both record and run VBA macros. Excel for the web cannot record, run or edit VBA macros, although you can still open and edit a .xlsm file there. For automation in the browser, Excel for the web uses <strong>Office Scripts<\/strong> on the <strong>Automate<\/strong> tab instead, where your Microsoft 365 plan includes it.<\/p>\n\n\n\n<h2 id=\"h-practice-on-your-own-spreadsheet\" class=\"wp-block-heading has-h-4-font-size\">Practice on your own spreadsheet<\/h2>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\">Pick a task you repeat every week, such as tidying a data export, and record it as a macro on a copy of the file. Start with a few steps, test it, then build up. If the task involves cleaning data, our guide on how to <a href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-remove-duplicates-in-excel\">remove duplicates in Excel<\/a> covers a step worth recording. Once the macro works, <a href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-lock-cells-in-excel\">lock the cells<\/a> other people should not change.<\/p>\n\n\n\n<p class=\"has-normal-font-size wp-block-paragraph\"><strong>Recording and running macros is covered in our <a href=\"https:\/\/www.dynamicwebtraining.com.au\/microsoft-excel-training-courses\/advanced-excel-course\">Advanced Excel course<\/a>, and our <a href=\"https:\/\/www.dynamicwebtraining.com.au\/microsoft-excel-training-courses\/excel-visual-basic-course\">Excel VBA course<\/a> teaches you to write your own code. Both are part of our <a href=\"https:\/\/www.dynamicwebtraining.com.au\/microsoft-excel-training-courses\">instructor-led Excel training courses<\/a>, in-class in Sydney and Melbourne or Online Live across Australia. For the bigger picture, see our <a href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/complete-guide-to-microsoft-excel\">Complete Guide to Microsoft Excel<\/a>.<\/strong><\/p>\n\n\n\n<h2 id=\"h-frequently-asked-questions\" class=\"wp-block-heading has-h-4-font-size\">Frequently asked questions<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block has-normal-font-size\"><div class=\"schema-faq-section\" id=\"faq-question-1794181495323\"><strong class=\"schema-faq-question\">What is a macro in Excel?<\/strong> <p class=\"schema-faq-answer\">A macro is a recorded set of actions that Excel stores as VBA code and can replay with one click or shortcut. Macros are used to automate repetitive tasks such as formatting reports or cleaning imported data.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1794181512891\"><strong class=\"schema-faq-question\">How do you record a macro in Excel?<\/strong> <p class=\"schema-faq-answer\">Go to View > Macros > Record Macro, enter a name and click OK. Carry out the steps you want to automate, then go to View > Macros > Stop Recording. Save the file as an Excel Macro-Enabled Workbook (.xlsm).<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1794181520929\"><strong class=\"schema-faq-question\">How do you enable macros in Excel?<\/strong> <p class=\"schema-faq-answer\">When you open a file you trust, click Enable Content on the yellow Security Warning bar. If a red bar says the macros are blocked, close the file, right-click it in File Explorer, choose Properties, tick Unblock, then reopen it and enable content.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1794181535584\"><strong class=\"schema-faq-question\">Why are macros blocked in Excel?<\/strong> <p class=\"schema-faq-answer\">Excel blocks macros in files downloaded from the internet or received by email because macros can contain malicious code. If you trust the file, unblock it in File Explorer under Properties, or save it to a trusted location.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1794181550881\"><strong class=\"schema-faq-question\">Are Excel macros safe?<\/strong> <p class=\"schema-faq-answer\">Macros you record yourself are safe. Macros in files from other people can contain harmful code, so only enable macros in files from sources you trust, and keep the default setting that disables macros with a notification.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1794181562519\"><strong class=\"schema-faq-question\">What is the difference between a macro and VBA?<\/strong> <p class=\"schema-faq-answer\">A macro is the automated task, and VBA (Visual Basic for Applications) is the programming language it is written in. Recording a macro writes the VBA for you, while writing VBA yourself lets you add loops, decisions and other logic.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>A macro in Excel is a recorded series of actions, such as formatting a report or cleaning imported data, that Excel saves as VBA code and can replay whenever you need it. To create one, go to View > Macros > Record Macro, give it a name, carry out the steps once, then click Stop&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2859","post","type-post","status-publish","format-standard","hentry","category-microsoft-excel"],"yoast_head":"<title>What Is a Macro in Excel? (And How to Record One)<\/title>\n<meta name=\"description\" content=\"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is a Macro in Excel? (And How to Record One)\" \/>\n<meta property=\"og:description\" content=\"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel\" \/>\n<meta property=\"og:site_name\" content=\"Dynamic Web Training Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-08T23:50:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-09T00:06:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dynamic Web Training\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dynamicwebtrain\" \/>\n<meta name=\"twitter:site\" content=\"@dynamicwebtrain\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dynamic Web Training\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel\"},\"author\":{\"name\":\"Dynamic Web Training\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#\\\/schema\\\/person\\\/c94653aed4a6decc8e357af0a1082233\"},\"headline\":\"What Is a Macro in Excel? (And How to Record One)\",\"datePublished\":\"2026-11-08T23:50:14+00:00\",\"dateModified\":\"2026-11-09T00:06:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel\"},\"wordCount\":1518,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/DWT-Excel-Macros-hero-A-1024x538.png\",\"articleSection\":[\"Microsoft Excel\"],\"inLanguage\":\"en-AU\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel\",\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel\",\"name\":\"What Is a Macro in Excel? (And How to Record One)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/DWT-Excel-Macros-hero-A-1024x538.png\",\"datePublished\":\"2026-11-08T23:50:14+00:00\",\"dateModified\":\"2026-11-09T00:06:50+00:00\",\"description\":\"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181495323\"},{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181512891\"},{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181520929\"},{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181535584\"},{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181550881\"},{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181562519\"}],\"inLanguage\":\"en-AU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-AU\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#primaryimage\",\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/DWT-Excel-Macros-hero-A.png\",\"contentUrl\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/DWT-Excel-Macros-hero-A.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Training Blog\",\"item\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Training\",\"item\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/category\\\/training\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft Excel\",\"item\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/category\\\/training\\\/microsoft-excel\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"What Is a Macro in Excel? (And How to Record One)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/\",\"name\":\"Dynamic Web Training Blog\",\"description\":\"The Ultimate Training Experience.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-AU\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#organization\",\"name\":\"Dynamic Web Training\",\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-AU\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/logo.png\",\"width\":361,\"height\":109,\"caption\":\"Dynamic Web Training\",\"name\":\"Dynamic Web Training Logo\",\"description\":\"Dynamic Web Training official site logo asset\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/DynamicWebTraining\\\/\",\"https:\\\/\\\/x.com\\\/dynamicwebtrain\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/#\\\/schema\\\/person\\\/c94653aed4a6decc8e357af0a1082233\",\"name\":\"Dynamic Web Training\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-AU\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g\",\"caption\":\"Dynamic Web Training\"},\"description\":\"This article is written by a senior writer at Dynamic Web Training. Our specialist writers are either Microsoft Certified Trainers, Adobe Certified Professionals or Certified Xero Advisors.\",\"sameAs\":[\"https:\\\/\\\/www.dynamicwebtraining.com.au\",\"https:\\\/\\\/www.facebook.com\\\/DynamicWebTraining\\\/\",\"https:\\\/\\\/www.instagram.com\\\/dynamicwebtraining\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dynamic-web-training\",\"https:\\\/\\\/x.com\\\/dynamicwebtrain\",\"www.youtube.com\\\/@dynamicwebtraining8740\"],\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181495323\",\"position\":1,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181495323\",\"name\":\"What is a macro in Excel?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"A macro is a recorded set of actions that Excel stores as VBA code and can replay with one click or shortcut. Macros are used to automate repetitive tasks such as formatting reports or cleaning imported data.\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181512891\",\"position\":2,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181512891\",\"name\":\"How do you record a macro in Excel?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Go to View > Macros > Record Macro, enter a name and click OK. Carry out the steps you want to automate, then go to View > Macros > Stop Recording. Save the file as an Excel Macro-Enabled Workbook (.xlsm).\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181520929\",\"position\":3,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181520929\",\"name\":\"How do you enable macros in Excel?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"When you open a file you trust, click Enable Content on the yellow Security Warning bar. If a red bar says the macros are blocked, close the file, right-click it in File Explorer, choose Properties, tick Unblock, then reopen it and enable content.\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181535584\",\"position\":4,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181535584\",\"name\":\"Why are macros blocked in Excel?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Excel blocks macros in files downloaded from the internet or received by email because macros can contain malicious code. If you trust the file, unblock it in File Explorer under Properties, or save it to a trusted location.\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181550881\",\"position\":5,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181550881\",\"name\":\"Are Excel macros safe?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Macros you record yourself are safe. Macros in files from other people can contain harmful code, so only enable macros in files from sources you trust, and keep the default setting that disables macros with a notification.\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181562519\",\"position\":6,\"url\":\"https:\\\/\\\/www.dynamicwebtraining.com.au\\\/blog\\\/what-is-a-macro-in-excel#faq-question-1794181562519\",\"name\":\"What is the difference between a macro and VBA?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"A macro is the automated task, and VBA (Visual Basic for Applications) is the programming language it is written in. Recording a macro writes the VBA for you, while writing VBA yourself lets you add loops, decisions and other logic.\",\"inLanguage\":\"en-AU\"},\"inLanguage\":\"en-AU\"}]}<\/script>","yoast_head_json":{"title":"What Is a Macro in Excel? (And How to Record One)","description":"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel","og_locale":"en_US","og_type":"article","og_title":"What Is a Macro in Excel? (And How to Record One)","og_description":"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.","og_url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel","og_site_name":"Dynamic Web Training Blog","article_publisher":"https:\/\/www.facebook.com\/DynamicWebTraining\/","article_author":"https:\/\/www.facebook.com\/DynamicWebTraining\/","article_published_time":"2026-11-08T23:50:14+00:00","article_modified_time":"2026-11-09T00:06:50+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A.png","type":"image\/png"}],"author":"Dynamic Web Training","twitter_card":"summary_large_image","twitter_creator":"@dynamicwebtrain","twitter_site":"@dynamicwebtrain","twitter_misc":{"Written by":"Dynamic Web Training","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#article","isPartOf":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel"},"author":{"name":"Dynamic Web Training","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233"},"headline":"What Is a Macro in Excel? (And How to Record One)","datePublished":"2026-11-08T23:50:14+00:00","dateModified":"2026-11-09T00:06:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel"},"wordCount":1518,"publisher":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization"},"image":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#primaryimage"},"thumbnailUrl":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A-1024x538.png","articleSection":["Microsoft Excel"],"inLanguage":"en-AU"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel","url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel","name":"What Is a Macro in Excel? (And How to Record One)","isPartOf":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#primaryimage"},"image":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#primaryimage"},"thumbnailUrl":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A-1024x538.png","datePublished":"2026-11-08T23:50:14+00:00","dateModified":"2026-11-09T00:06:50+00:00","description":"What is a macro in Excel? Learn what macros do, how to record and run one, save it as .xlsm, and how to enable macros safely when Excel blocks them.","breadcrumb":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181495323"},{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181512891"},{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181520929"},{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181535584"},{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181550881"},{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181562519"}],"inLanguage":"en-AU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel"]}]},{"@type":"ImageObject","inLanguage":"en-AU","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#primaryimage","url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A.png","contentUrl":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2026\/11\/DWT-Excel-Macros-hero-A.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Training Blog","item":"https:\/\/www.dynamicwebtraining.com.au\/blog\/"},{"@type":"ListItem","position":2,"name":"Training","item":"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training"},{"@type":"ListItem","position":3,"name":"Microsoft Excel","item":"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training\/microsoft-excel"},{"@type":"ListItem","position":4,"name":"What Is a Macro in Excel? (And How to Record One)"}]},{"@type":"WebSite","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website","url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/","name":"Dynamic Web Training Blog","description":"The Ultimate Training Experience.","publisher":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dynamicwebtraining.com.au\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-AU"},{"@type":"Organization","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization","name":"Dynamic Web Training","url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-AU","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2016\/02\/logo.png","contentUrl":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2016\/02\/logo.png","width":361,"height":109,"caption":"Dynamic Web Training","name":"Dynamic Web Training Logo","description":"Dynamic Web Training official site logo asset"},"image":{"@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DynamicWebTraining\/","https:\/\/x.com\/dynamicwebtrain"]},{"@type":"Person","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233","name":"Dynamic Web Training","image":{"@type":"ImageObject","inLanguage":"en-AU","@id":"https:\/\/secure.gravatar.com\/avatar\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g","caption":"Dynamic Web Training"},"description":"This article is written by a senior writer at Dynamic Web Training. Our specialist writers are either Microsoft Certified Trainers, Adobe Certified Professionals or Certified Xero Advisors.","sameAs":["https:\/\/www.dynamicwebtraining.com.au","https:\/\/www.facebook.com\/DynamicWebTraining\/","https:\/\/www.instagram.com\/dynamicwebtraining\/","https:\/\/www.linkedin.com\/company\/dynamic-web-training","https:\/\/x.com\/dynamicwebtrain","www.youtube.com\/@dynamicwebtraining8740"],"url":"https:\/\/www.dynamicwebtraining.com.au"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181495323","position":1,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181495323","name":"What is a macro in Excel?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"A macro is a recorded set of actions that Excel stores as VBA code and can replay with one click or shortcut. Macros are used to automate repetitive tasks such as formatting reports or cleaning imported data.","inLanguage":"en-AU"},"inLanguage":"en-AU"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181512891","position":2,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181512891","name":"How do you record a macro in Excel?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Go to View > Macros > Record Macro, enter a name and click OK. Carry out the steps you want to automate, then go to View > Macros > Stop Recording. Save the file as an Excel Macro-Enabled Workbook (.xlsm).","inLanguage":"en-AU"},"inLanguage":"en-AU"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181520929","position":3,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181520929","name":"How do you enable macros in Excel?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"When you open a file you trust, click Enable Content on the yellow Security Warning bar. If a red bar says the macros are blocked, close the file, right-click it in File Explorer, choose Properties, tick Unblock, then reopen it and enable content.","inLanguage":"en-AU"},"inLanguage":"en-AU"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181535584","position":4,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181535584","name":"Why are macros blocked in Excel?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Excel blocks macros in files downloaded from the internet or received by email because macros can contain malicious code. If you trust the file, unblock it in File Explorer under Properties, or save it to a trusted location.","inLanguage":"en-AU"},"inLanguage":"en-AU"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181550881","position":5,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181550881","name":"Are Excel macros safe?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Macros you record yourself are safe. Macros in files from other people can contain harmful code, so only enable macros in files from sources you trust, and keep the default setting that disables macros with a notification.","inLanguage":"en-AU"},"inLanguage":"en-AU"},{"@type":"Question","@id":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181562519","position":6,"url":"https:\/\/www.dynamicwebtraining.com.au\/blog\/what-is-a-macro-in-excel#faq-question-1794181562519","name":"What is the difference between a macro and VBA?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"A macro is the automated task, and VBA (Visual Basic for Applications) is the programming language it is written in. Recording a macro writes the VBA for you, while writing VBA yourself lets you add loops, decisions and other logic.","inLanguage":"en-AU"},"inLanguage":"en-AU"}]}},"_links":{"self":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/comments?post=2859"}],"version-history":[{"count":2,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2859\/revisions"}],"predecessor-version":[{"id":2866,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2859\/revisions\/2866"}],"wp:attachment":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/media?parent=2859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/categories?post=2859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/tags?post=2859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}