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
Attaching the macro excel sheet need solution
Thanks
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 <<<
>>> 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
Thanks
Attachments
Last edited by a moderator: