Hi guys,
Complete newbie to VBA! I have created a stock management worksheet that I "simply" want to add or subtract from a running total with a click button to carry out the function. At the minute I have the following code:
I could potentially have hundreds of lines running in rows that I would want this function to be carried out for if a value is present in column H (Goods In) or column I (Goods Out). I therefore also need to ignore blank cells.
I'm sure this is very straight forward but I'm stumped!
Thanks
Ryan
Complete newbie to VBA! I have created a stock management worksheet that I "simply" want to add or subtract from a running total with a click button to carry out the function. At the minute I have the following code:
Code:
Private Sub commandbutton1_click()
Range("J5").Value = Range("J5").Value + Range("H5").Value
Range("J5").Value = Range("J5").Value - Range("I5").Value
Range("H5:I2000").ClearContents
End Sub
I could potentially have hundreds of lines running in rows that I would want this function to be carried out for if a value is present in column H (Goods In) or column I (Goods Out). I therefore also need to ignore blank cells.
I'm sure this is very straight forward but I'm stumped!
Thanks
Ryan