Ravindra BagaleCourses & study guides मराठी Track your progress

12. Macros and VBA

12.1 Developer Tab, Macro Security and .xlsm

Steps in Excel

  1. Show the Developer tab: File › Options › Customize Ribbon › in the right list tick Developer › OK. Groups: Code (Visual Basic, Macros, Record Macro, Use Relative References, Macro Security), Add-ins, Controls, XML.
  2. Macro security: Developer › Code › Macro Security (or File › Options › Trust Center › Trust Center Settings… › Macro Settings). Options:
    • Disable VBA macros without notification
    • Disable VBA macros with notification – recommended/default: a yellow bar offers Enable Content for files you trust
    • Disable VBA macros except digitally signed macros
    • Enable VBA macros – not recommended
  3. Trusted Locations (same dialog): add a folder such as D:\ExcelMacros\ – files there open with macros enabled.
  4. Save with macros: File › Save As › Save as type: Excel Macro-Enabled Workbook (*.xlsm). Saving as .xlsx deletes the code (Excel warns you).
  5. A downloaded .xlsm shows a red Security Risk bar: if you trust it, close it, right-click the file in File Explorer › Properties › tick Unblock › OK.
Format Macros? Use
.xlsx No Normal workbooks
.xlsm Yes Workbooks with macros
.xlsb Yes Binary – smaller/faster for very large files
.xlam Yes Add-ins (functions available in all workbooks)

About this data: Teaching sample for a fictional shop “NovaCraft Tools”. Figures and names (e.g. Sana Sheikh) are made up for this lesson on developer tab macro security and xlsm.

Ravindra Bagale's Tip

Writing a macro and saving it as .xlsx is the most painful mistake many students make, because if you click "Yes" on Excel's warning, all the code is gone! Save the file as .xlsm from your very first macro. And don't set security to "Enable all macros" – Disable with notification is the safe option.

Worked example — developer tab macro security and xlsm

Why

Sana Sheikh in Pune and Liam Murphy abroad both need a clear, repeatable way to use developer tab macro security and xlsm on a BrightLedger Finance sheet without breaking totals.

What

Developer Tab Macro Security And Xlsm is the Excel idea this page teaches. We will walk one tiny example end to end.

How

  1. Open a blank sheet. In A1 type a short label for developer tab macro security and xlsm.
  2. Enter a small made-up value for Sana Sheikh using £ where money appears.
  3. Add a second value for Liam Murphy using € so you see mixed currencies stay numeric.
  4. Apply the method from this lesson step by step (menu or formula as shown above).
  5. Check the result still works inside SUM or a simple check cell.

Formula / action

Follow the formula or ribbon steps shown in this lesson (keep values numeric).
Result: The demo cell shows the expected result for BrightLedger Finance's sample row.
Meaning: Once developer tab macro security and xlsm is correct on one row, copy the same pattern down the column.

Practice tasks (10+)

Try these on a blank sheet. Open a hint only if you are stuck. No quiz — just practice.

1. Rebuild the smallest example of developer tab macro security and xlsm on a blank sheet for Skyline Clinics.

Hint: Use only the steps on this page. Keep numbers numeric.

2. Change one input for Aarti Kulkarni and confirm the result updates.

Hint: If the result is stuck, check absolute vs relative references.

3. Repeat the same steps with a £ or € value for Liam Murphy.

Hint: Formatting must not break SUM.

4. Write the result meaning in one plain sentence next to the cell.

Hint: Imagine explaining it to a new joiners.

5. Add a second row and fill the method down.

Hint: Double-click the fill handle if the pattern is consistent.

6. Break the example on purpose, then fix it using this lesson.

Hint: Common break: text instead of a number.

7. Apply developer tab macro security and xlsm to a 5-row made-up Skyline Clinics table.

Hint: Keep column headers clear.

8. Check your answer with a simple total or COUNT.

Hint: A wrong total usually means a format or key mismatch.

9. Swap ₹ and $ on one column and re-check totals.

Hint: Stored values stay the same; only the display changes.

10. List two mistakes beginners make with developer tab macro security and xlsm.

Hint: Look back at the tip box on this page.

11. Teach the steps out loud in under one minute.

Hint: Why → What → How.

12. Save the sheet as SkylineClin_practice.xlsx.

Hint: Use a clear file name for class.

Loading practice tasks...

  1. Last used row (Easy): Which row number is the last filled row? The headings are in row 1.
  2. Late orders (Easy): How many rows have Status "Late"?
  3. Total amount (Easy): Add up the Amount column.
  4. Worst delay (Easy): What is the largest number in the Days late column?
  5. Late orders in Pune (Medium): How many orders are Late and in City "Pune"?
  6. Customer for an order (Medium): Find the Customer for Order ID "DL-704".
  7. Money stuck in late orders (Medium): Add up the Amount column for rows where Status is "Late".
  8. Big orders (Medium): How many rows have an Amount of 2000 or more?
  9. Message text (Medium): Build the text "N late orders", where N is the count of Late rows.
  10. Average delay of late orders (Hard): What is the average Days late for rows with Status "Late"? Round to 1 decimal.
  11. Tag for the first row (Hard): For the first row, return "Chase" if Days late is 3 or more, else "OK".
  12. Warning or all clear (Hard): Return "Warning" if any order is 3 or more days late, else "All clear".

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Developer Tab Macro Security And Xlsm?
Card 1: What is Developer Tab Macro Security And Xlsm? · Download PNG
Revision card 2: Tiny example — Developer Tab Macro Security And Xlsm
Card 2: Tiny example — Developer Tab Macro Security And Xlsm · Download PNG
Revision card 3: Checklist — Developer Tab Macro Security And Xlsm
Card 3: Checklist — Developer Tab Macro Security And Xlsm · Download PNG