. This problem will give you practice using a Do/While loop in VBA. Write a VBA
ID: 3628350 • Letter: #
Question
. This problem will give you practice using a Do/While loop in VBA. Write a VBA function called “sequence” that allows the user to specify a limit (a positive number). For this limit, your function should return the smallest number n where the sum 1 + 2 + … + n is greater than the specified limit. Your function should have the following general form:
1. Begin by assuming that n is 0
2. Also, assume that the sum is initially 0
3. Set up a Do/While loop that iterates while the sum does not exceed the specified limit
4. Inside the loop, increase n by 1 (e.g., n = n + 1)
5. Also inside the loop, update the sum to include the new n value
You can verify that your function is working by trying these cases. If the limit is 6, then n = 4. If the limit is 40, then n = 9.