لم تدكر اخي ما هو النطاق المطلوب
تفضل جرب هل هدا ما تقصده
Sub CopySheet()
Dim filePath$, folderName$, Fname$
Dim rCopy As Range, rng As Range
Dim lRow As Long, i As Integer
Dim wbSource As Workbook
Set wbSource = ThisWorkbook
Set WS = wbSource.Worksheets("Sheet1")
lRow = WS.Range("B" & WS.Rows.Count).End(xlUp).Row
Set rCopy = WS.Range("A7:K" & lRow).SpecialCells(xlCellTypeVisible)
folderName = "ملفات Excel"
Fname = "تقرير النشاط"
filePath = ThisWorkbook.path & "\" & folderName
On Error Resume Next
'OR
'filePath = "D:" & "\" & folderName
If WS.Range("L9:L" & lRow).SpecialCells(xlCellTypeVisible).Count > 1 Then
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.CopyObjectsWithCells = False
Set newWb = Workbooks.Add: Set SH = newWb.Sheets(1)
rCopy.Copy Destination:=SH.Range("A3")
LastR = SH.Range("A" & SH.Rows.Count).End(xlUp).Row
SH.Range("A7:A" & LastR).RowHeight = 28
For i = 1 To 11
Columns(i).ColumnWidth = WS.Columns(i).ColumnWidth
Next i
SH.[A5] = 1: SH.Range("A5:A" & SH.Cells(Rows.Count, 2).End(3).Row).DataSeries , xlLinear
'Columns(1).Delete
If Dir(filePath, vbDirectory) = "" Then MkDir filePath
newWb.SaveAs fileName:=filePath & "\" & Fname & ".xlsx", FileFormat:=51
newWb.Close
.CopyObjectsWithCells = True
.DisplayAlerts = True
.ScreenUpdating = True
End With
sMsg = "Excel" & " " & "تم حفظ التقرير بنجاح في مجلد " & "ملفات"
MsgBox sMsg, vbExclamation, " من تاريخ: " & " " & WS.[D4] & " " & "إلى تاريخ:" & " " & WS.[F4]
Else
MsgBox "لا توجد بيانات للحفظ", vbInformation, "تم إلغاء الإجراء"
End If
End Sub
فلترة وحفظ.xlsm