PC World - USA (2020-03)

(Antfer) #1
126 PCWorld MARCH 2020

HERE’S HOW HOW TO CREATE EXCEL MACROS


the Master. The Master is the spreadsheet for
the combined totals of all stores. If you are
the one who collates all the data and
executes the Master macros AND you also
manage an individual store, you must use
one of the 12 sheets you copied for your
store. The Master is for the grand totals only.


  1. Once the branches email their
    individual spreadsheets, it’s safer to copy the
    individual sheets from the 12 stores’
    workbooks manually.


PROGRAMMING MACROS
Macro1: Collect and combine data


  1. Access your database folder and open
    your spreadsheet titled MasterDB.xlsx
    2. Open one of the new store
    spreadsheets, such as the one titled


BostonDB.xlsx


  1. Move your cursor back to the
    MasterDB so it’s the active sheet.

  2. Select the Developer tab and click
    Record Macro or press ALT+ L+ R. The
    Macro Name field says Macro1, and that’s a
    good name.

  3. Enter a shortcut key (if you like) in the
    Shortcut_key field box (enter the letter M)
    (you can create a button on the Ribbon
    menu later).

  4. In the Store Macro In field box, click
    the down arrow and select Personal Macro
    Workbook from the list, then click OK.
    Now you are recording the macro.
    Follow the instructions below, exactly,
    and use your mouse to navigate around the
    spreadsheet. Please note that phrases inside
    square brackets are tips,
    notes, and explanations of
    the instructions. Do not
    include these phrases or
    anything they say in your
    macro.

  5. Move back to the
    BostonDB spreadsheet, then
    right-click the Boston tab. In
    the popup menu, select
    Move or Copy ...

  6. In the Move or Copy
    dialog, check the box that
    says Copy.

  7. In the Move Selected
    Record macro dialog box, macro shortcut_key. Sheets dialog, click the down

Free download pdf