Sub
CheckAndFixDates(CheckRange
As
Range)
Dim
rngRw
As
Range, rngInsert
As
Range
Dim
datWeek
As
Date
, datTrading
As
Date
Dim
iRw
As
Integer
iRw = 1
Do
While
iRw < CheckRange.Rows.Count
Set
rngRw = CheckRange.Rows(iRw)
rngRw.
Select
If
IsDate(rngRw.Cells(1))
And
IsDate(rngRw.Cells(2))
Then
datWeek = rngRw.Cells(1)
datTrading = rngRw.Cells(2)
If
DateDiff(
"d"
, datWeek, datTrading) < 0
Then
Set
rngInsert = Intersect(rngRw, rngRw.Offset(0, 1))
rngInsert.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End
If
End
If
iRw = iRw + 1
Loop
End
Sub