xxxxxxxxxx
Sub M()
Set Sh = Sheets("Sheet1")
Lastrow = Sh.Cells(Rows.Count, "E").End(xlUp).Row
For i = 5 To Lastrow
If Sh.Range("E" & i).Value = "Yearly" Then
'Application.DisplayAlerts = False 'Uncomment If you Dont need error msg to pop
Sh.Range("J" & i & ":U" & i).Merge
End If
Next
End Sub