hi all,
I need a VBA programme to compare the date time data type in a row with corresponding datetime data in preceding row and if found unequal then it must put a space of there by shifting adjacent three values in the row down
this is the code
Sub mywork()
Dim dtmDatemain As Date
Dim dtmDate As Date
For iRow = 1 To 696
dtmDate = ActiveCell.Value
dtmDatemain = ActiveCell.Offset(0, -1).Value
If dtmDate = dtmDatemain Then
ActiveCell.Offset(1, 0).Range("A1").Select
Else
ActiveCell.Range("A1:C1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Select
ActiveCell.Offset(1, 0).Range("A1").Select
End If
Next iRow
End Sub