Try this excel macroSub test()k 0For i 100000000 To 999999999
If (i Mod 7 0) Then k k + 1 End If Next Cells(1 1) k End SubAns: