J
Jim May
Often I will engage Auto-Filter on a Data Table, and once I've filtered on
it
I want to Create a New File to contain only the Current displayed Rows
(Visible Only);
The below code is not acheiving, new file is created but contains all rows
from original.
What am I missing here?
TIA,
Sub CopySheetToNewFile()
Dim NameOfSheet As String
NameOfSheet = ActiveSheet.Name
Selection.SpecialCells(xlCellTypeVisible).Select
Worksheets(NameOfSheet).Copy
ChDir "C:\My Documents\Excel Formulas\SheetNamesToFiles\"
ActiveWorkbook.SaveAs Filename:=NameOfSheet & ".xls"
ChDir "C:\My Documents\"
End Sub
it
I want to Create a New File to contain only the Current displayed Rows
(Visible Only);
The below code is not acheiving, new file is created but contains all rows
from original.
What am I missing here?
TIA,
Sub CopySheetToNewFile()
Dim NameOfSheet As String
NameOfSheet = ActiveSheet.Name
Selection.SpecialCells(xlCellTypeVisible).Select
Worksheets(NameOfSheet).Copy
ChDir "C:\My Documents\Excel Formulas\SheetNamesToFiles\"
ActiveWorkbook.SaveAs Filename:=NameOfSheet & ".xls"
ChDir "C:\My Documents\"
End Sub