
Originally Posted by
cdurfey
This works great except it does not bring over to column headers. Can you help with that? I have almost destroyed the macro. Thanks
Not sure what you mean by "I have almost destroyed the macro", but this modified version of what I posted earlier should do what I think you want...
Code:
Dim ColLetter As String, SavePath As String
Dim VisibleRows As Range, WS As Worksheet, wbOld As Workbook, wbNew As Workbook
ColLetter = "K"
Set wbOld = ThisWorkbook
Set wbNew = Application.Workbooks.Add(xlWorksheet)
Set WS = wbOld.Worksheets(1)
WS.Cells.AutoFilter field:=WS.Cells(1, ColLetter).Column, Criteria1:="Y"
WS.AutoFilter.Range.SpecialCells(xlVisible).Copy wbNew.Worksheets(1).Range("A1")
WS.AutoFilterMode = False
Bookmarks