title: Filter content in .xls with .vbs
body: <p>I have an .xls file (sheet 1), where there is an x amount of rows and a set amount of columns (always 9), of which the 6th column has to be filtered on a specific partial string ("Hello" has to be displayed when filtered on both "hello" and/or "ell"). This data then has to be copied into worksheet 2 of another .xls (sheet 2). I've set up a template in which the current format of the schedule can be set (worksheet 2 of sheet 2), which will then convert it into the new format (worksheet 1 of sheet 2). I have no knowledge of .vbs at all, but when I did some research on how to make this as automatic as possible, I got the advice to have a .bat file request a .vbs file, which made it easy to alter the excel content. I've tried to find out how to work with the .vbs script, but most of the .vbs used to alter .xls files is the 'easier' tasks, as renaming a worksheet. If anyone can just point me in the right direction, that would be amazing.</p>
  
  <p>Edit:
  This is what I have so far</p>
  
  <pre><code>'launch Excel and open file
   Set xlObj = CreateObject("Excel.Application")
   Set xlFile = xlObj.WorkBooks.Open("C:\test.xls")
  'turn off screen alerts
   xlObj.Application.DisplayAlerts = False
  
  Columns("F:F").Select
  Selection.AutoFilter
  ActiveSheet.Range("$F$2:$F$200").AutoFilter Field:=1, Criteria1:=FilterData, Operator:=xlFilterValue
  
  Dim LR As Long
  LR = Range("A" &amp; Rows.Count).End(.xlUp).Row
  set Source = Range("A2:P" &amp; LR).SpecialCells(xlCellTypeVisible).Select
  Source.Copy
  
  Set xlObj = CreateObject("Excel.Application")
  Set xlFile = xlObj.WorkBooks.Open("C:\test2.xls")
  'turn off screen alerts
  xlObj.Application.DisplayAlerts = False
  
  set Dest = Range("A1")
  Dest.Paste
  Next
  xlFile.Close true
  xlObj.Quit
  
  Next  
  'save, close, then quit
  xlFile.Close true
  xlObj.Quit
  </code></pre>