Sub test() Cells(1, 1).Select For i = 1 To 100 three = i / 3 five = i / 5 If (three - Int(three)) = 0 And (five - Int(five)) = 0 Then ActiveCell.Value = "div by 3 and 5 - " & i ActiveCell.Offset(1, 0).Select ElseIf (three - Int(three)) = 0 Then ActiveCell.Value = "div by 3 - " & i ActiveCell.Offset(1, 0).Select ElseIf (five - Int(five)) = 0 Then ActiveCell.Value = "div by 5 - " & i ActiveCell.Offset(1, 0).Select End If Next i Cells(1, 1).Select End Sub