Ok give this a shot
Sub sort()
Dim last_row As Integer
Dim i As Integer
Dim j As Integer
last_row = Cells(Rows.Count, 2).End(xlUp).Row
For i = 5 To last_row
If Cells(i, 5).Value + Cells(i, 6).Value > 0 Then Cells(i, 4).Value = "MDE"
Next i
For j = 7 To 14
If IsNumeric(Cells(4, j)) Then
For i = 5 To last_row
If Cells(i, j).Value <> 0 And Cells(i, 4).Value <> "MDE" Then Cells(i, 4).Value = "CR"
Next i
End If
If Cells(4, j).Value = "Other" Then
For i = 5 To last_row
If Cells(i, j).Value <> 0 And Cells(i, 4).Value <> "MDE" And Cells(i, 4).Value <> "CR" Then Cells(i, 4).Value = "Other"
Next i
End If
If Cells(4, j).Value = "DDE" Then
For i = 5 To last_row
If Cells(i, j).Value <> 0 And Cells(i, 4).Value <> "MDE" And Cells(i, 4).Value <> "CR" And Cells(i, 4).Value <> "Other" Then Cells(i, 4).Value = "DDE"
Next i
End If
Next j
End Sub
Bookmarks