title: Run-time error '13': Type Mismatch Post Office Update
body: <p>I previously created code to clean out a spreadsheet. It worked perfectly but it seems that O365 updated and the code broke.</p>
  <p>I am still recuperating from COVID and I am having a hard time reading this as my vision was imapcted permanenetly. Could anyone help me understand why it's breaking and where I went wrong? I've</p>
  <p>I have not updated this code in over a year and was the last time I wrote a VBS script so I am a bit lost at the moment.</p>
  <p>The code breaks at <strong>If rngCell.Value &gt; &quot;&quot; Then</strong> and is the *<em>422</em> line</p>
  <p>Currently trying to find if there's a way for it to provide a better detailed error when it crashes for easier troubleshooting in the future.</p>
  <pre><code>Dim i As Long
  
  
  For i = Cells(Rows.Count, &quot;J&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;J&quot;) &lt;&gt; &quot;Yes&quot; Then Rows(i).Delete
  Next i
  
  For i = Cells(Rows.Count, &quot;K&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;K&quot;) &lt;&gt; &quot;Yes&quot; Then Rows(i).Delete
  Next i
  
  For i = Cells(Rows.Count, &quot;O&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;O&quot;) &lt;&gt; &quot;Headquarters&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;4205&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;2151&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;3446&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;205&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;233&quot; And Cells(i, &quot;O&quot;) &lt;&gt; &quot;2182&quot; Then Rows(i).Delete
  Next i
  
  Columns(1).EntireColumn.Delete
  Columns(1).EntireColumn.Delete
  Columns(1).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  Columns(7).EntireColumn.Delete
  
  Range(&quot;C:F&quot; &amp; LastRow).Replace &quot;&quot;, &quot;999&quot;, xlWhole
  
  For i = Cells(Rows.Count, &quot;A&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;C&quot;).Value2 &gt; 10 And Cells(i, &quot;D&quot;).Value2 &gt; 10 And Cells(i, &quot;E&quot;).Value2 &gt; 10 And Cells(i, &quot;F&quot;).Value2 &gt; 10 Then
          Rows(i).Delete
      End If
  Next i
  
  
  
  ActiveSheet.Name = &quot;Sheet1&quot;
  
  Range(&quot;G1&quot;).Value = &quot;Queue Name&quot;
  Range(&quot;G2&quot;).Value = &quot;=VLOOKUP(B2,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G3&quot;).Value = &quot;=VLOOKUP(B3,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G4&quot;).Value = &quot;=VLOOKUP(B4,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G5&quot;).Value = &quot;=VLOOKUP(B5,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G6&quot;).Value = &quot;=VLOOKUP(B6,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G7&quot;).Value = &quot;=VLOOKUP(B7,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G8&quot;).Value = &quot;=VLOOKUP(B8,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G9&quot;).Value = &quot;=VLOOKUP(B9,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G10&quot;).Value = &quot;=VLOOKUP(B10,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G11&quot;).Value = &quot;=VLOOKUP(B11,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G12&quot;).Value = &quot;=VLOOKUP(B12,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G13&quot;).Value = &quot;=VLOOKUP(B13,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G14&quot;).Value = &quot;=VLOOKUP(B14,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G15&quot;).Value = &quot;=VLOOKUP(B15,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G16&quot;).Value = &quot;=VLOOKUP(B16,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G17&quot;).Value = &quot;=VLOOKUP(B17,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G18&quot;).Value = &quot;=VLOOKUP(B18,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G19&quot;).Value = &quot;=VLOOKUP(B19,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G20&quot;).Value = &quot;=VLOOKUP(B20,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G21&quot;).Value = &quot;=VLOOKUP(B21,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G22&quot;).Value = &quot;=VLOOKUP(B22,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G23&quot;).Value = &quot;=VLOOKUP(B23,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G24&quot;).Value = &quot;=VLOOKUP(B24,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G25&quot;).Value = &quot;=VLOOKUP(B25,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G26&quot;).Value = &quot;=VLOOKUP(B26,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G27&quot;).Value = &quot;=VLOOKUP(B27,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G28&quot;).Value = &quot;=VLOOKUP(B28,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G29&quot;).Value = &quot;=VLOOKUP(B29,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  Range(&quot;G30&quot;).Value = &quot;=VLOOKUP(B30,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,7,0)&quot;
  
  
  Range(&quot;H1&quot;).Value = &quot;Location&quot;
  Range(&quot;H2&quot;).Value = &quot;=VLOOKUP(B2,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H3&quot;).Value = &quot;=VLOOKUP(B3,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H4&quot;).Value = &quot;=VLOOKUP(B4,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H5&quot;).Value = &quot;=VLOOKUP(B5,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H6&quot;).Value = &quot;=VLOOKUP(B6,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H7&quot;).Value = &quot;=VLOOKUP(B7,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H8&quot;).Value = &quot;=VLOOKUP(B8,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H9&quot;).Value = &quot;=VLOOKUP(B9,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H10&quot;).Value = &quot;=VLOOKUP(B10,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H11&quot;).Value = &quot;=VLOOKUP(B11,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H12&quot;).Value = &quot;=VLOOKUP(B12,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H13&quot;).Value = &quot;=VLOOKUP(B13,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H14&quot;).Value = &quot;=VLOOKUP(B14,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H15&quot;).Value = &quot;=VLOOKUP(B15,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H16&quot;).Value = &quot;=VLOOKUP(B16,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H17&quot;).Value = &quot;=VLOOKUP(B17,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H18&quot;).Value = &quot;=VLOOKUP(B18,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H19&quot;).Value = &quot;=VLOOKUP(B19,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H20&quot;).Value = &quot;=VLOOKUP(B20,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H21&quot;).Value = &quot;=VLOOKUP(B21,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H22&quot;).Value = &quot;=VLOOKUP(B22,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H23&quot;).Value = &quot;=VLOOKUP(B23,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H24&quot;).Value = &quot;=VLOOKUP(B24,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H25&quot;).Value = &quot;=VLOOKUP(B25,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H26&quot;).Value = &quot;=VLOOKUP(B26,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H27&quot;).Value = &quot;=VLOOKUP(B27,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H28&quot;).Value = &quot;=VLOOKUP(B28,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H29&quot;).Value = &quot;=VLOOKUP(B29,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  Range(&quot;H30&quot;).Value = &quot;=VLOOKUP(B30,'\\server\server\server\server\[placement.xlsx]Printers'!$A$1:$N$230,5,0)&quot;
  
  Application.ScreenUpdating = False
  Columns(&quot;A:A&quot;).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
  Application.ScreenUpdating = True
  
  Cells.Select
      Selection.Copy
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
          :=False, Transpose:=False
  Cells.Select
      ActiveWorkbook.Worksheets(&quot;Sheet1&quot;).Sort.SortFields.Clear
      ActiveWorkbook.Worksheets(&quot;Sheet1&quot;).Sort.SortFields.Add2 Key:=Range(&quot;H2:H130&quot; _
          ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
      With ActiveWorkbook.Worksheets(&quot;Sheet1&quot;).Sort
          .SetRange Range(&quot;A1:O130&quot;)
          .Header = xlYes
          .MatchCase = False
          .Orientation = xlTopToBottom
          .SortMethod = xlPinYin
          .Apply
     End With
  
  
      Dim FindString As String
      Dim Rng As Range
  
          FindString = &quot;TYS&quot;
  
          With Sheets(&quot;Sheet1&quot;).Range(&quot;H:H&quot;)
              Set Rng = .Find(What:=FindString, _
                              After:=.Cells(.Cells.Count), _
                              LookIn:=xlValues, _
                              LookAt:=xlWhole, _
                              SearchOrder:=xlByRows, _
                              SearchDirection:=xlNext, _
                              MatchCase:=False)
              If Not Rng Is Nothing Then
                  Application.Goto Rng, True
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.Offset(1, -1).Activate
                  ActiveCell.Value = &quot;TYSONS (9TH FLOOR)&quot;
                  Range(Cells(Selection.Row, 1), Cells(Selection.Row, 7)).Select
                  With Selection
          .HorizontalAlignment = xlCenter
          .VerticalAlignment = xlCenter
          .WrapText = False
          .Orientation = 0
          .AddIndent = False
          .IndentLevel = 0
          .ShrinkToFit = False
          .ReadingOrder = xlContext
          .MergeCells = True
      End With
         Selection.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(1, 0).Activate
      ActiveCell.Value = &quot;Model&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Serial Number&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Black&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Cyan&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Magenta&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Yellow&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Queue Name&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
              Else
              End If
          End With
  
  
          FindString = &quot;SPF&quot;
  
          With Sheets(&quot;Sheet1&quot;).Range(&quot;H:H&quot;)
              Set Rng = .Find(What:=FindString, _
                              After:=.Cells(.Cells.Count), _
                              LookIn:=xlValues, _
                              LookAt:=xlWhole, _
                              SearchOrder:=xlByRows, _
                              SearchDirection:=xlNext, _
                              MatchCase:=False)
             If Not Rng Is Nothing Then
                  Application.Goto Rng, True
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.Offset(1, -1).Activate
                  ActiveCell.Value = &quot;SPF&quot;
                  Range(Cells(Selection.Row, 1), Cells(Selection.Row, 7)).Select
                  With Selection
          .HorizontalAlignment = xlCenter
          .VerticalAlignment = xlCenter
          .WrapText = False
          .Orientation = 0
          .AddIndent = False
          .IndentLevel = 0
          .ShrinkToFit = False
          .ReadingOrder = xlContext
          .MergeCells = True
      End With
      Selection.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(1, 0).Activate
      ActiveCell.Value = &quot;Model&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Serial Number&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Black&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Cyan&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Magenta&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Yellow&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Queue Name&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
              Else
              End If
          End With
  
      FindString = &quot;WFR&quot;
  
          With Sheets(&quot;Sheet1&quot;).Range(&quot;H:H&quot;)
              Set Rng = .Find(What:=FindString, _
                              After:=.Cells(.Cells.Count), _
                              LookIn:=xlValues, _
                              LookAt:=xlWhole, _
                              SearchOrder:=xlByRows, _
                              SearchDirection:=xlNext, _
                              MatchCase:=False)
              If Not Rng Is Nothing Then
                  Application.Goto Rng, True
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.Offset(1, -1).Activate
                  ActiveCell.Value = &quot;WHARF&quot;
                  Range(Cells(Selection.Row, 1), Cells(Selection.Row, 7)).Select
                  With Selection
          .HorizontalAlignment = xlCenter
          .VerticalAlignment = xlCenter
          .WrapText = False
          .Orientation = 0
          .AddIndent = False
          .IndentLevel = 0
          .ShrinkToFit = False
          .ReadingOrder = xlContext
          .MergeCells = True
      End With
            Selection.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(1, 0).Activate
      ActiveCell.Value = &quot;Model&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Serial Number&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Black&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Cyan&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Magenta&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Yellow&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Queue Name&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
              Else
             End If
          End With
  
    FindString = &quot;TES&quot;
  
          With Sheets(&quot;Sheet1&quot;).Range(&quot;H:H&quot;)
              Set Rng = .Find(What:=FindString, _
                              After:=.Cells(.Cells.Count), _
                              LookIn:=xlValues, _
                              LookAt:=xlWhole, _
                              SearchOrder:=xlByRows, _
                              SearchDirection:=xlNext, _
                              MatchCase:=False)
              If Not Rng Is Nothing Then
                  Application.Goto Rng, True
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.EntireRow.Insert
                  ActiveCell.Offset(1, -1).Activate
                  ActiveCell.Value = &quot;TYSONS (WGES)&quot;
                  Range(Cells(Selection.Row, 1), Cells(Selection.Row, 7)).Select
                  With Selection
          .HorizontalAlignment = xlCenter
          .VerticalAlignment = xlCenter
          .WrapText = False
          .Orientation = 0
          .AddIndent = False
          .IndentLevel = 0
          .ShrinkToFit = False
          .ReadingOrder = xlContext
          .MergeCells = True
      End With
      Selection.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(1, 0).Activate
      ActiveCell.Value = &quot;Model&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Serial Number&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Black&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Cyan&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Magenta&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
       ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Yellow&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = &quot;Queue Name&quot;
      ActiveCell.Font.Bold = True
      ActiveCell.Interior.ColorIndex = 1
      ActiveCell.Font.Color = RGB(255, 255, 255)
              Else
              End If
          End With
          
  
  Application.ScreenUpdating = False
  Dim lngLstCol As Long, lngLstRow As Long
  
  lngLstRow = ActiveSheet.UsedRange.Rows.Count
  lngLstCol = ActiveSheet.UsedRange.Columns.Count
  
  Dim rngCell As Variant
  For Each rngCell In Range(&quot;A1:G100&quot; &amp; lngLstRow)
      If rngCell.Value &gt; &quot;&quot; Then
          r = rngCell.Row
          c = rngCell.Column
          Range(Cells(r, c), Cells(r, lngLstCol)).Select
              With Selection.Borders
                  .LineStyle = xlContinuous
                  .Weight = xlThin
                  .ColorIndex = xlAutomatic
              End With
     End If
  Next
  
  Application.ScreenUpdating = True
  Columns(8).EntireColumn.Delete
  
  Range(&quot;C:F&quot; &amp; LastRow).Replace &quot;&quot;, &quot;999&quot;, xlWhole
  For i = Cells(Rows.Count, &quot;C&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;C&quot;).Value2 &lt;= 10 Then
      Cells(i, &quot;C&quot;).Interior.ColorIndex = 15
      End If
  Next i
  
  For i = Cells(Rows.Count, &quot;D&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;D&quot;).Value2 &lt;= 10 Then
      Cells(i, &quot;D&quot;).Interior.ColorIndex = 8
      End If
  Next i
  
  For i = Cells(Rows.Count, &quot;E&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;E&quot;).Value2 &lt;= 10 Then
      Cells(i, &quot;E&quot;).Interior.ColorIndex = 3
      End If
  Next i
  
  For i = Cells(Rows.Count, &quot;F&quot;).End(xlUp).Row To 2 Step -1
      If Cells(i, &quot;F&quot;).Value2 &lt;= 10 Then
     Cells(i, &quot;F&quot;).Interior.ColorIndex = 6
      End If
  Next i
  
  
  Application.Calculation = xlAutomatic
  Range(&quot;C:F&quot; &amp; LastRow).Replace &quot;999&quot;, &quot;&quot;, xlWhole
  
  Cells.Select
      Cells.EntireColumn.AutoFit
      
  Rows(1).Delete
  Rows(1).Delete
  Range(&quot;H1&quot;).Select
  
  ActiveWindow.DisplayGridlines = False
  End Sub
  </code></pre>