PC World - USA (2020-03)

(Antfer) #1
MARCH 2020 PCWorld 131

displaying all the macros saved to the “All
Open Workbooks” area.



  1. Locate your macro, click to select,
    then click the Step Into button.

  2. Your macro code appears in the Visual
    Basic macro debug window
    The first line says: Sub macroname()
    Sub means Subroutine, which alerts
    Excel that a macro follows. “Sub” begins the
    macro and “End Sub” ends it. The next line
    shows the macro name (I named it xdebug().
    Sub xdebug()
    The next section says this:
    Select Range C3. Then enter formula
    =SUM(RC[-1]*10%) in that ActiveCell
    The following commands are similar:


Select Range D3. Then enter formula
=SUM(RC[-2]*32%) in that ActiveCell
Select Range E3. Then enter formula
=SUM(RC[-3]:RC[-1]) in that ActiveCell
Next, it says:
Select Range C3 through E3 and Copy
Select Range C4 through E12 and Paste
Application.CutCopyMode = False [this
means clear the clipboard]
Then it continues with:
Select Range E4
Select the End key, then go down one row
Select Range E13. Then enter formula w
in that ActiveCell
These next lines are text alignment
commands:

How to
debug a
macro.
Free download pdf