Sub gah() Dim weeks, absent As Integer Dim here As Boolean absent = 0 here = False Range("B6").Select Do Until IsEmpty(ActiveCell.Offset(0, 1)) ActiveCell.Offset(0, 1).Select Loop weeks = ActiveCell.Column - 1 Do Until IsEmpty(ActiveCell.Offset(0, -weeks)) Do While (absent > -weeks And here = False) If Not ActiveCell.Offset(0, absent) = 1 Then absent = absent - 1 Else here = True If absent = 3 Then MsgBox (ActiveCell.Offset(0, -weeks) + " 3 weeks") Else If absent = 5 Then MsgBox (ActiveCell.Offset(0, -weeks) + " 5 weeks") Else If absent = 7 Then MsgBox (ActiveCell.Offset(0, -weeks) + " 7 weeks") End If End If Loop here = False absent = 0 ActiveCell.Offset(1, 0).Select Loop End Sub