Download ArticleDownload Article

This How.com.vn teaches you how to automate the reporting of data in Microsoft Excel. For external data, this How.com.vn will teach you how to query and create reports from any external data source (MySQL, Postgres, Oracle, etc) from within your worksheet using Excel plugins that link your worksheet to external data sources.

For data already stored in an Excel worksheet, we will use macros to build reports and export them in a variety of file types with the press of one key. Luckily, Excel comes with a built-in step recorder which means you will not have to code the macros yourself.

Method 1
Method 1 of 2:

For Data Already In Excel

Download Article
  1. How.com.vn English: Step 1 If the data...
    If the data you need to report on is already stored, updated, and maintained in Excel, you can automate reporting workflows using Macros. Macros are a built in function that allow you to automate complex and repetitive tasks.
  2. How.com.vn English: Step 2 Open Excel.
    Double-click (or click if you're on a Mac) the Excel app icon, which resembles a white "X" on a green background, then click Blank Workbook on the templates page.
    • On a Mac, you may have to click File and then click New Blank Workbook in the resulting drop-down menu.
    • If you already have an Excel report that you want to automate, you'll instead double-click the report's file to open it in Excel.
    Advertisement
  3. How.com.vn English: Step 3 Enter your spreadsheet's data if necessary.
    If you haven't added the column labels and numbers for which you want to automate results, do so before proceeding.
  4. How.com.vn English: Step 4 Enable the Developer tab.
    By default, the Developer tab doesn't show up at the top of the Excel window. You can enable it by doing the following depending on your operating system:
    • Windows — Click File, click Options, click Customize Ribbon on the left side of the window, check the "Developer" box in the lower-right side of the window (you may first have to scroll down), and click OK.[1]
    • Mac — Click Excel, click Preferences..., click Ribbon & Toolbar, check the "Developer" box in the "Main Tabs" list, and click Save.[2]
  5. How.com.vn English: Step 5 Click Developer.
    This tab should now be at the top of the Excel window. Doing so brings up a toolbar at the top of the Excel window.
  6. How.com.vn English: Step 6 Click Record Macro.
    It's in the toolbar. A pop-up window will appear.
  7. How.com.vn English: Step 7 Enter a name for the macro.
    In the "Macro name" text box, type in the name for your macro. This will help you identify the macro later.
    • For example, if you're creating a macro that will make a chart out of your available data, you might name it "Chart1" or similar.
  8. How.com.vn English: Step 8 Create a shortcut key combination for the macro.
    Press the Shift key along with another key (e.g., the T key) to create the keyboard shortcut. This is what you'll use to run your macro later.
    • On a Mac, the shortcut key combination will end up being Option+ Command and your key (e.g., Option+ Command+T).
  9. How.com.vn English: Step 9 Store the macro in the current Excel document.
    Click the "Store macro in" drop-down box, then click This Workbook to ensure that the macro will be available for anyone who opens the workbook.
    • You'll have to save the Excel file in a special format for the macro to be saved.
  10. How.com.vn English: Step 10 Click OK.
    It's at the bottom of the window. Doing so will save your macro settings and place you in record mode. Any steps you take from now until you stop the recording will be recorded.
  11. How.com.vn English: Step 11 Perform the steps that you want to automate.
    Excel will track every click, keystroke, and formatting option you enter and add them to the macro's list.
    • For example, to select data and create a chart out of it, you would highlight your data, click Insert at the top of the Excel window, click a chart type, click the chart format that you want to use, and edit the chart as needed.
    • If you wanted to use the macro to add values from cells A1 through A12, you would click an empty cell, type in =SUM(A1:A12), and press Enter.
  12. How.com.vn English: Step 12 Click Stop Recording.
    It's in the Developer tab's toolbar. This will stop your recording and save any steps you took during the recording as an individual macro.
  13. How.com.vn English: Step 13 Save your Excel sheet as a macro-enabled file.
    Click File, click Save As, and change the file format to xlsm instead of xls. You can then enter a file name, select a file location, and click Save.
    • If you don't do this, the macro won't be saved as part of the spreadsheet, meaning that other people on different computers won't be able to use your macro if you send the workbook to them.
  14. How.com.vn English: Step 14 Run your macro.
    Press the key combination which you created as part of the macro to do so. You should see your spreadsheet automate according to your macro's steps.
    • You can also run a macro by clicking Macros in the Developer tab, selecting your macro's name, and clicking Run.
  15. Advertisement
Method 2
Method 2 of 2:

For External Data (MySQL, Postgres, Oracle, etc)

Download Article
  1. How.com.vn English: Step 1 Download Kloudio's Excel...
    Download Kloudio's Excel plugin from Microsoft AppSource. This will allow you to create a persistent connection between an external database or data source and your workbook. This plugin also works with Google Sheets.
  2. How.com.vn English: Step 2 Create a connection between your worksheet and your external data source by clicking the + button on the Kloudio portal.
    Type in the details of your database (database type, credentials) and select any security/encryption options if working with confidential or company data.
  3. How.com.vn English: Step 3 Once you've created...
    Once you've created a connection between your worksheet and your database, you will be able to query and build reports from external data without leaving Excel. Create your custom reports from the Kloudio portal and then select them from the drop-down menu in Excel. You can then apply any additional filters and choose the frequency that the report will refresh (so you can have your sales spreadsheet update automatically every week, day, or even hour.)
  4. How.com.vn English: Step 4 In addition, you can also input data into your connected worksheet and have the data update your external data source.
    Create an upload template from the Kloudio portal and you will be able to manually or automatically upload changes in your spreadsheet to your external data source.
  5. Advertisement

Video

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      • When opening a spreadsheet with your macro included, you may have to click Enable Content in a yellow banner at the top of the window before you can use the macro.
      • Only download Excel plugins from Microsoft AppSource, unless you trust the third party provider.
      • Macros can be used for anything from simple tasks (e.g., adding values or creating a chart) to complex ones (e.g., calculating your cell's values, creating a chart from the results, labeling the chart, and printing the result).
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Macros can be used maliciously (e.g., to delete files on your computer). Don't run macros from untrustworthy sources.
      • Macros will implement literally every step you make while recording. Make sure that you don't accidentally enter the incorrect value, open a program you don't want to use, or delete a file.
      Advertisement

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 575,759 times.
      How helpful is this?
      Co-authors: 10
      Updated: April 6, 2024
      Views: 575,759
      Categories: Microsoft Excel
      Article SummaryX

      1.Enable the Developer tab.
      2.Click the Developer tab.
      3.Click Record Macro.
      4.Create a shortcut key.
      5.Store the content in the current workbook.
      6.Click OK.
      7.Perform the steps you want to automate.
      8.Click Stop Recording.
      9.Use the shortcut key to run the same steps.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 575,759 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement