0

I need your help regarding my homework. The aim is to sum all even numbers from Fibonacci sequence till the sum reach < 100

I have created formula as below

Sub fibbo()

Dim sum As Long
Dim a As Long
Dim b As Long
sum = 0

    Do While sum < 100

        sum = a + b
        a = b
        b = sum
        a = a + 1

    Loop

Range("A1").Value = sum

End Sub

The problem is that sum is over 100.

Please help. Thank you in advance.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
goodk
  • 1

0 Answers0