Simple Macro in Excel

 

Enabling Macros

Enabling Macros

Firstly open Excel. Enabling macros procedure is similar to Excel 2010, 2013, and 2016. There is a slight difference for Excel in Mac. This will be detailed below.

File

  • Tap the File tab.
    Tap the “Excel” menu in Excel for Mac.
  • Tap Options.options
    Tap the “Preferences” menu option in Excel for Mac.
  • Tap the Customize Ribbon option.custommize ribbon
    Tap “Ribbon & Toolbar” in the “Authoring” section in Excel for Mac.
  • Check the Developer box in the list on the right.Developer
    You’ll see “Developer” in the “Tap or Group Title” list in Excel for Mac.OK
  • Tap OK. You’ll see the Developer tab appear at the end of your tab list.

Recording a Macro

Recording a Macro

  • The macro sequence should be practiced. Anything you tap or do will be recorded when you record a macro. So a single slip-up can ruin the whole thing. By running the commands you’ll be recording two times. So that you can do them without misclicks and hesitation.Developer
  • Tap the Developer tab.Record Macro
  • Tap Record Macro. You’ll find this in the Code section of the ribbon. You can also press Alt+T+M+R to start a new macro (Windows only).
  • Give a name to the macro. Confirm that you’ll be able to easily identify it. Especially if you’re going to create multiple macros.
    To explain what the macro will accomplish, you can also add a description.Shortcut key
  • Tap the Shortcut key field. To easily run, you can assign a keyboard shortcut to the macro. This is optional. Shift
  • Press Shift plus a letter. This creates a Ctrl+Shift+letter keyboard combination to start the macro. This will be a ⌥ Opt+⌘ Command+letter combination on Mac.Store macro in
  • Tap the Store macro in the menu.save the macro
  • Tap the location you want to save the macro. If you’re only using the macro for your current spreadsheet, just leave it on “This Workbook.” Select “Personal Macro Workbook,” if you want the macro available for any spreadsheet you work on.OK
  • Tap OK. Your macro starts recording.commands
  • Whatever the command you want to record, perform them. Pretty much anything you do will now be recorded and added to the macro. For instance, running the macro in the future will always sum A2 and B2 and display the results in C7, if you run a sum formula of A2 and B2 in cell C7.
    Macros can get very complex, and you can even use them to open other Office programs. Virtually everything you do in Excel is added to the macro when the macro is recording.Stop Recording
  • Tap Stop Recording once if you finish. This will end the macro recording and save it.macro-enabled format
  • Save your file in a macro-enabled format. You’ll need to save your workbook as a special macro-enabled Excel format in order to preserve your macros:
    Tap the File menu and select Save.
    Tap the File Type menu underneath the file name field.
    Tap Excel Macro-Enabled Workbook.

Using a Macro

  • Open your macro-enabled workbook file. You’ll be prompted to enable the content if you have closed your file before running your macro.Enable Content
  • Tap Enable Content. This appears at the top of the Excel spreadsheet in a Security Warning bar whenever a macro-enabled workbook is opened. You can trust it since it’s your own file. On concord, be very careful opening macro-enabled files from any other source.macro shortcut
  • Press your macro shortcut. You can quickly run it by pressing the shortcut you created for it when you want to use your macro.Macros
  • Tap the Macros button on the Developer tab. It displays all of the macros that are available in your current spreadsheet.
  • Tap the macro you want to run.
  • Tap the Run button. The macro will be run in your current selection or cell.
  • View a macro’s code. You can open the code of any macro if you want to learn more about how macro coding works you’ve created and tinker with it:
  • Tap the Macros button on the Developer tab.
  • Tap the macro you want to view.

Tap the Edit button.View your macro code in the Visual Basic code editing window.


You May Also Like: 7 Excel Tips That Will Impress Your Boss