Public Sub FillInEmpty()
Dim lastRow As Long 'depuis excel 2007, un integer ne suffit plus pour compter les lignes ...
Dim DerCol As Byte
Dim i As Long 'Quitte à déclarer tes variables, déclare les toutes ...
Dim ws As Worksheet
Dim Rep As Integer
Set ws = Sheets("Page1_1")
Rep = MsgBox("Are you willing to copy all dates into this column?", vbYesNo + vbQuestion, "xld")
If Rep # vbYes Then exit sub
Application.ScreenUpdating = False
With ws
lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
DerCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For i = 1 To lastRow
If .Cells(i, DerCol) = "" Then
Year_Date = Mid(.Cells(i, 29).Text, 1, 4)
Month_Date = Mid(.Cells(i, 29).Text, 5, 2)
.Cells(i, 35) = DateSerial(Year_Date, Month_Date, 1)
.Cells(i, 35).NumberFormat = "mm-yyyy"
End If
Next i
End With
End Sub