Sub qwertyuiopsdfwy (qwertyuiopsdyt, qwertyuiopsdts, qwertyuiopsdyq, qwertyuiopsdyu, qwertyuiopsdye, qwertyuiopsdyr): qwertyuiopsdre Dim As Integer: Dim qwertyuiopsdyy As Integer Dim qwertyuiopsdyi: qwertyuiopsdyy = qwertyuiopsdfgpy: qwertyuiopsdyi = qwertyuiopsdfgeu: Sheets (qwertyuiopsdyt) .Visible = qwertyuiopsdfgew: Đặt qwertyuiopsdey = Sheets (qwertyuiopsdyt): Sheets (qwertyuiopsdyt) .Copy: Với ActiveSheet: Rows (qwertyuiopsdfgsu) .Insert: qwertyuiopsdre = .Cells (Rows.Count, qwertyuiopsdfgis ). End (xlUp) .RowIf qwertyuiopsdye = qwertyuiopsdyr Thenqwertyuiopsdyu = qwertyuiopsdfgsi & Format (qwertyuiopsdye, qwertyuiopsdfgoe): End Nếu: Với Range (qwertyuiopsdfgso): .Value = qwertyuiopsdyq: .HorizontalAlignment = xlCenter: .Font.Size = qwertyuiopsdfgpp: End With: Với Range (qwertyuiopsdfgsp): .Value = Replace (Replace (qwertyuiopsdyu, qwertyuiopsdfgss, Format (qwertyuiopsdye, qwertyuiopsdfgoe)), qwertyuiopsdfgsd, Format (qwertyuiopsdyr, qwertyuiopsdfgoe)): .HorizontalAlignment = xlCenter: .Font.Italic = qwertyuiopsdfgew: End Nếu qwertyuiopsdre> qwertyuiopsdfgtr + qwertyuiopsdyi ThenRange (qwertyuiopsdfgp & qwertyuiopsdre + qwertyuiopsdfgeu) .Value = .Range (qwertyuiopsdfgp & qwertyuiopsdfgtr + qwertyuiopsdyi) .Value: Range (qwertyuiopsdfgp & qwertyuiopsdre + qwertyuiopsdfgtr) .Value = qwertyuiopsdfgod & qwertyuiopsdye: Range (qwertyuiopsdfge & qwertyuiopsdre + qwertyuiopsdfgeu). Value = .Range (qwertyuiopsdfgp & qwertyuiopsdfgtr + qwertyuiopsdyi) .Value: Range (qwertyuiopsdfge & qwertyuiopsdre + qwertyuiopsdfgtr) .Value = qwertyuiopsdfgpe & Format (DateAdd (qwertyuiopsdfgou, qwertyuiopsdfgwt, qwertyuiopsdyr), qwertyuiopsdfgsf) Range (qwertyuiopsdfgto & qwertyuiopsdfgtr + qwertyuiopsdyi & qwertyuiopsdfgsg & qwertyuiopsdre) .AdvancedFilter Action: = xlFilterCopy, CriteriaRange: = Range (qwertyuiopsdfgp & qwertyuiopsdre + qwertyuiopsdfgeu & qwertyuiopsdfgee & qwertyuiopsdfge & qwertyuiopsdre + qwertyuiopsdfgtr), CopyToRange: = Range (qwertyuiopsdfgto & qwertyuiopsdre + qwertyuiopsdyy), Unique: = qwertyuiopsdfgg: Range (qwertyuiopsdfgto & qwertyuiopsdre + qwertyuiopsdyy - qwertyuiopsdfgwt) .Select: Range (Selection, Selection.End (xlUp)) Chọn: Range (Selection, Selection.End (xlUp)) SelectSelection.EntireRow.Delete Shift: = xlUp: qwertyuiopsdre = .Cells .. ( Rows.Count, qwertyuiopsdfgeu) .End (xlUp) .Row: Range (qwertyuiopsdfgrs & qwertyuiopsdfgeu + qwertyuiopsdyi) .Formula = qwertyuiopsdfgdq & qwertyuiopsdfgtr + qwertyuiopsdyi & qwertyuiopsdfgdw & qwertyuiopsdre & qwertyuiopsdfgde: Range (qwertyuiopsdfgsr) = qwertyuiopsdfgwtIf qwertyuiopsdre> qwertyuiopsdfgis ThenRange (qwertyuiopsdfgdr) = qwertyuiopsdfgeu: Nếu qwertyuiopsdre> qwertyuiopsdfgpy Sau đó, Range (qwertyuiopsdfgdt) .AutoFill Range (qwertyuiopsdfgdy & qwertyuiopsdre) End If: End Nếu: .name = qwertyuiopsdts: End With: ActiveWindow.FreezePanes = qwertyuiopsdfgg: End Sub