السلام عليكم
جرب هذا
Sub dahmour()
l = Range("b" & Rows.Count).End(xlUp).Row
For x = 3 To l
t = 0
col = 34
For Each c In Range("c" & x & ":ag" & x)
If t = 0 Then
If c = "A" Then
Cells(x, col) = DateSerial(Year([a2]), Month([a2]), Cells(2, c.Column).Value)
t = t + 1
col = col + 1
End If
Else
If c = "A" Then
t = t + 1
Else
Cells(x, col) = DateSerial(Year([a2]), Month([a2]), Cells(2, c.Column - 1).Value)
t = 0
col = col + 1
End If
End If
Next
Next
End Sub
تحياتي
CODE+.rar