Sub Cleanup() '------------------------------------------------------------------------------ ' Author : Jason Brigham ' Date : 12/11/2009 ' Purpose: To remove all left over {skip} and {hop} tags from the sheets of the ' current workbook. To use this macro, set the "Run Macro After" to ' "Cleanup" in the Buddy Excel Job. This will clear out any left over ' tags once the job has finished running. ' ' Disclaimer: This macro has been written to assist customers and should be used ' at your own risk. Prolink assumes no liability for deleted data if ' this macro is used. ' '------------------------------------------------------------------------------ Dim oRange As Range Dim oSheet As Worksheet For Each oSheet In ActiveWorkbook.Sheets 'first get rid of any skips Do Set oRange = oSheet.Cells.Find(What:="{skip}", LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False) If Not oRange Is Nothing Then oRange.ClearContents End If Loop Until oRange Is Nothing 'now do the hop tag Do Set oRange = oSheet.Cells.Find(What:="{hop:*}", LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False) If Not oRange Is Nothing Then oRange.ClearContents End If Loop Until oRange Is Nothing Next oSheet End Sub