View Single Post
Old 15-08-2009, 13:08   #43
Reedy
Inactive
 
Join Date: Jun 2009
Posts: 139
Reedy is just really niceReedy is just really niceReedy is just really niceReedy is just really niceReedy is just really niceReedy is just really nice
Re: Programming Challenges?

Excel vba.

Spoiler: 
Code:
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
Reedy is offline   Reply With Quote