Listing 1: XLFindDups Subroutine Sub XLFindDups posit=instr(sourcecode,"Sub XLFindDups") endposit = instr(sourcecode,"Sub XLSubtotals") textareabox1.innerText = mid(sourcecode,posit,endposit-posit) Const xlExpression = 2 : Const xlPasteFormats = -4122 : Const xlNone = -4142 Const xlToRight = -4161 : Const xlToLeft = -4159 : Const xlDown = -4121 Set XL = CreateObject("Excel.Application") XL.Workbooks.Add XL.Sheets.Add.name = "Concatenate" XL.ActiveWorkbook.Sheets("Concatenate").Tab.ColorIndex = 4 XL.Visible = TRUE XL.Cells(1,1).Value = "FirstName" : XL.Cells(1,2).Value = "MI" : XL.Cells(1,3).Value = "LastName" XL.Cells(2,1).Value = "Jesse" : XL.Cells(2,2).Value = "L" : XL.Cells(2,3).Value = "Roberts" XL.Cells(3,1).Value = "Mary" : XL.Cells(3,2).Value = "S" : XL.Cells(3,3).Value = "Talbert" XL.Cells(4,1).Value = "Ben" : XL.Cells(4,2).Value = "N" : XL.Cells(4,3).Value = "Smith" XL.Cells(5,1).Value = "Ed" : XL.Cells(5,2).Value = "S" : XL.Cells(5,3).Value = "Turner" XL.Cells(6,1).Value = "Mary" : XL.Cells(6,2).Value = "S" : XL.Cells(6,3).Value = "Talbert" XL.Cells(7,1).Value = "Jesse" : XL.Cells(7,2).Value = "L" : XL.Cells(7,3).Value = "Roberts" XL.Cells(8,1).Value = "Joe" : XL.Cells(8,2).Value = "L" : XL.Cells(8,3).Value = "Smith" XL.Cells(9,1).Value = "Ben" : XL.Cells(9,2).Value = "A" : XL.Cells(9,3).Value = "Smith" lastrow=9 XL.Rows("2:2").Select XL.ActiveWindow.FreezePanes = True XL.Cells.EntireColumn.AutoFit '*** BEGIN CALLOUT A XL.Range("A1").Select XL.Columns("A:A").Select XL.Selection.Insert xlToRight XL.Range("A1").Select XL.Cells(1, 1).Value = "Concat" XL.Range("A2").Select XL.ActiveCell.FormulaR1C1 = "=CONCATENATE(C[+1],C[+2],C[+3])" XL.Selection.AutoFill XL.Range("A2" & ":" & "A" & lastrow) XL.Cells.EntireColumn.Autofit '*** END CALLOUT A '*** BEGIN CALLOUT B XL.Range("A1").Select XL.Range(XL.Selection, XL.ActiveCell.SpecialCells(11)).Select XL.Selection.Copy XL.Range("A2").Select XL.Sheets.Add.name = "FindDups" XL.ActiveWorkbook.Sheets("FindDups").Tab.ColorIndex = 5 XL.Sheets("FindDups").Select XL.ActiveSheet.Paste '*** END CALLOUT B '*** BEGIN CALLOUT C XL.Range("A1").Select XL.Columns("B:B").Select XL.Selection.Insert xlToLeft XL.Range("B1").Select XL.Cells(1, 2).Value = "Dups" XL.Range("B2").Select XL.ActiveCell.FormulaR1C1 = "=COUNTIF(C[-1],RC[-1])>1" XL.Range("B2").Select XL.Selection.AutoFill XL.Range("B2" & ":" & "B" & lastrow) '*** END CALLOUT C '*** BEGIN CALLOUT D XL.Range("B2").Select XL.Selection.FormatConditions.Delete XL.Selection.FormatConditions.Add xlExpression,, "=COUNTIF(A:A,A2)>1" XL.Selection.FormatConditions(1).Interior.ColorIndex = 42 XL.Selection.Copy XL.Columns("B:B").Select 'XL.Range("B2").Activate 'XL.Selection.PasteSpecial xlPasteFormats, xlNone, False, False XL.Selection.PasteSpecial xlPasteFormats '*** END CALLOUT D XL.Range("A2").Select 'XL.Selection.Sort xl.Range("B2"),2,xl.Range("A2"),,1,xl.Range("C2"),1,1,1,False,,1 XL.Range("A:E").Sort xl.Range("B2"),2,xl.Range("A2"),,1,xl.Range("C2"),1,1,1,False,,1 XL.Rows("2:2").Select XL.ActiveWindow.FreezePanes = True XL.Cells.EntireColumn.Autofit XL.Columns("A:A").Select XL.Selection.EntireColumn.Hidden = True XL.Range("B2").Select End Sub