title: How do I copy all visible cells with vba code?
body: <p>I have a large data set. In column A I have branch codes. I have filtered my data according to a specific branch code. Now lets say there are 3300 lines left after filtering my data. If I select all, F5, visible cells only, and I copy and paste the data to a new sheet, it only copies about 300 lines. (In VBA and when I do it manually) Why is this happening? Is there a way to adapt my code so that it copies all of the data to a new sheet?</p>
  
  <p>I will show my code below</p>
  
  <pre><code>Sheets("Open Orders").Select
  Range("Table_OpenOrders[[#Headers],[Branch Plant]]").Select
  Range(Selection, Selection.End(xlToRight)).Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.SpecialCells(xlCellTypeVisible).Select
  Selection.copy
  Sheets("Copy Open Orders").Select
  Range("A1").Select
  Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks 
   _
            :=False, Transpose:=False
  Columns("D:F").Select
  Application.CutCopyMode = False
  </code></pre>