Option Explicit
Public Sub InsertCell()
On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Long
Dim TLoi
TLoi = MsgBox("Ban co muon tao backup du lieu trong sheet hien hanh khong?", vbInformation + vbYesNo)
If TLoi = vbYes Then ActiveSheet.Copy Before:=ActiveSheet
Dim shtName As Worksheet
Set shtName = ActiveSheet
'Khoi tao gia tri bien i de xac dinh dong dau tien trong khoi du lieu
i = InputBox("Nhap dong du lieu dau tien trong vung du lieu can Insert", , 9)
If Err.Number <> 0 Then Exit Sub
Do
i = i + 1
If Cells(i, "A") <> Cells(i - 1, "A") And Not IsEmpty(Cells(i - 1, "A")) Then
Rows(i & ":" & i + 5).Select
Selection.Insert Shift:=xlDown
'Copy 6 dong
Sheets("Sheet1").Select
Range("A2:W8").Select
Selection.Copy
shtName.Select
Cells(i, "A").Select
ActiveSheet.Paste
i = i + 5
End If
Loop While i <= (ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1)
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub