Thank you so much Steve. that is very kind of you. I already understand the code and thank you again for your answer. I noticed your message a little late and already built up the following code myself,For the record, your original post was worded so that we assumed you simply wanted help accomplishing this yourself. Which is why nobody had provided the code for you at first. I think you had experienced coders eager to teach you to do this yourself. This is your homework after all. That being said, this accomplishes your task.Code:
Sub Loop_Test() Do Until iTotal > 100 i = CInt(InputBox("Enter a number.", "Current Total = " & iTotal)) iTotal = iTotal + i Loop MsgBox "Your final total is: " & iTotal, vbOKOnly, "Final Total" End Sub
I really do hope you take the time to understand what was written for the sake of your education.
And I encourage you to ask questions about how this code works. We will be happy to help.
***As another note, I am not sure if you have any 'stability' requirements for this. But that code is very unstable as written (for example, entering anything other than a number in the input box will cause an error without some kind of data validation catch.***
Do until x = 100
X = x + 1
Message = "Give a number "
Userinput = InputBox(Message)
Userinput = Val(Userinput)
Do Until Validnumber = True
MsgBox "Sum of the numbers is " & sum
I know that the loop is not right but anyway. thanks again...!