اذا كنت تريد ترحيل اوراق الايام الى ورقة "مصروفات السيارات"
إستخدم الكود التالي
Private Const Nm As String = "مصروفات السيارات"
Public N_Sh$
Public Sub Ali_Tr()
Dim Sh As Worksheet, S As Worksheet
Dim my_r As Range
Dim Lr&
Set S = Sheets(Nm)
S.Cells.Clear
For Each Sh In ThisWorkbook.Worksheets
With Sh
Select Case .Name
Case Is = Nm, "كشف حساب", "تقارير"
Case Else
N_Sh = .Name
Lr = S.Cells(S.Rows.Count, 2).End(xlUp).Offset(1, 0).Row
.Range("B14:J104").Copy
Set Rr = S.Range("B" & Lr + 1)
With Rr
.Offset(0, -1) = N_Sh
.PasteSpecial xlPasteValues
End With
With S.Range(S.Cells(Rr.Row, 1), S.Cells(Rr.Row, 10))
.Cells(1, 3) = Application.Text(.Cells(1, 3).Text, "[$-C01]dddd")
.Cells(1, 8) = Application.Text(.Cells(1, 8).Text, "yyyy/mm/dd")
.Cells(1, 8).Columns.AutoFit
.Font.Color = RGB(255, 0, 0)
.Font.Bold = True
.Borders.Color = 1
End With
End Select
End With
Next
End Sub