title: Automate Excel with VBScript to process Nagios Logs
body: <p>I'm using VBScript to extract a LOG file from Nagios XI. I have automated a script that will use IE.Aplication <code>navigate</code>, choose the right parameters (to filter) and export as CSV (Excel usable). That has been done!</p>
  
  <p>Now I want to filter MORE (of what Nagios can't do). I have multiple logs of CPU, and I want to DELETE ALL the rows contain this word. I found lots of scripts in VBA, but the problem in my case that I override the file each use this is the vba script I use (in another Excel). I need to change it to work from "outside" of the application (meaning from the main script)</p>
  
  <pre><code>Sub CellColor(rng As Range)
    For Each row In rng.Rows
      For Each cell In row.Cells
        If cell.Value = ActiveCell.Value Then  '--- The Condition of the function
          cell.Style = "Bad"                   '--- Changing the "Style" atribbute
        Else
          cell.Style = "Good"                  '--- Changing the "Style" atribbute
        End If
      Next cell
    Next row
  End Sub
  </code></pre>
  
  <p>Can any body advise on how to convert this?</p>