• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error in Do until statement

webmax

Member
I have three values in the excel sheet
B Column contains Opening stock
C Column contains Sold units
D column contains Closing stock

I put the below macro code if the closing is less than or equal to zero the process should stop . But the do until statement is working more than that

>>> You've noted many times <<<
>>> use code - tags <<<
Code:
Sub reconcile()
Dim i As Integer
Dim x As Integer
i = Range("D2").Value
x = Range("C2").Value

Do Until i <= 0
'Result = Result + i
x = x - 1
Range("C2").Value = x
If i <= 0 Then
End If
Loop

End Sub
Attaching the macro excel sheet need solution
Thanks
 

Attachments

  • reconcile.xlsm
    15.3 KB · Views: 2
Last edited by a moderator:
As I can't see any logic within the code so it can be trashed !​
Then according to any Excel forum rules - like for the code tags you have forgotten again ! -​
you must well elaborate with details each step to be achieved …​
 
Back
Top