السلام عليكم
تفضل أخى
Sub Ragab()
Dim cl As Range, sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If Not sh.Name = "الشيت الاساسي " Then
sh.Range("A1:F1000").ClearContents
End If
Next
LR = Cells(Rows.Count, 2).End(xlUp).Row
For Each cl In Range("C2:C" & LR)
x = Trim(cl.Value)
On Error Resume Next
If Worksheets(x) Is Nothing Then
Sheets.Add.Name = x
With Sheets(x)
.Move After:=Sheets(Sheets.Count)
.DisplayRightToLeft = True
End With
End If
Sheets("الشيت الاساسي ").Range("A1:F1").Copy
With Sheets(x)
.Range("A1").PasteSpecial xlPasteValues
.Range("A1").PasteSpecial xlPasteFormats
End With
cl.Offset(0, -2).Resize(1, 6).Copy
With Sheets(x)
.Cells(Sheets(x).Cells(Rows.Count, 1).End(xlUp).Row + 1, 1).PasteSpecial xlPasteValues
.Cells(Sheets(x).Cells(Rows.Count, 1).End(xlUp).Row, 1).PasteSpecial xlPasteFormats
.Cells(Sheets(x).Cells(Rows.Count, 1).End(xlUp).Row, 1).PasteSpecial xlPasteColumnWidths
.Cells(Sheets(x).Cells(Rows.Count, 2).End(xlUp).Row, 1) = Sheets(x).Cells(Sheets(x).Cells(Rows.Count, 2).End(xlUp).Row, 1).Row - 1
End With
Application.CutCopyMode = False
Next
MsgBox "تم الترحيل بنجاح الى صفحات منفصلة"
Sheets("الشيت الاساسي ").Select
Application.ScreenUpdating = False
End Sub
المبيعات الشهرية1.rar