Cleaning up {skip} and {hop} tags in your Excel worksheets
This provides a macro to clean up extra {skip} and {hop} tags for Buddy 3.2.
Print Friendly View
written: 12/11/2009
last modified: 04/12/2024


Sometimes you create a template with {skip} tags and/or {hop} tags throughout. You then have an Excel Job that sends the data to the spreadsheet skipping and hopping accordingly. But what if you don't send as much data on one of your runs? You may end up with some extra {skip} and {hop} tags since they aren't removed until the Buddy encounters them during export.

To get rid of these, we created a simple macro called "Cleanup". All you have to do is tell the Buddy Job to run this macro after the tag replacements and it will clear out any remaining tags. Below are the steps to accomplish this.

NOTE: This has become an option in the Excel Job Wizard in later versions of Buddy.


  1. Download the "Cleanupmacro.txt" file attached to this article.
  2. Open the Excel spreadsheet you are using as the template for your report.
  3. In Excel 2003, choose Tools > Macro > Macros...
    In Excel 2007, choose down arrow in the Macro button from the View tab of the ribbon.
  4. Type "junk" in the text box at the top of the Macro window and click Create.

  5. This will open the Visual Basic Editor and show the Junk Subroutine. Highlight all text in the window including Sub junk() and End Sub and delete it.

  6. Highlight all text in the CleanupMacro.txt file from this article and paste it in the window.

  7. Save your template spreadsheet and close it.
  8. In the SPC Office Buddy, edit your Excel Job by highlighting the job in the list and clicking the pencil icon
  9. Click Next >> 3 times until you reach the Excel Options screen.
  10. Check the box that says Show Advanced.
  11. Click Next >> to go to the Advanced Options screen.
  12. Type "Cleanup" in the text field called Run Macro After.
  13. Click Finish to save your Excel Job

When you run the job, it should automatically run the Cleanup macro when the tag replacements are finished. This macro will clear the remaining {skip} and {hop} tags leaving your finished report nice and clean.


Applies To

SPC Office Buddy v.3.20


Reporting - SPC Office Buddy
See more articles in this category