I hope there will be someone that can help with my question. I am trying to update the inventory of a specific product by using excel and the developer section commands. Thus I need t use a single button named as "add / subtract" in order to add or subtract a value of 1. I need to choose the part's icon and then by selecting these buttons to control its quantity. Please see the reference below:
By selecting the part in need, I want to hit the here button. This will select the actual barcode of the item and will display it in the text box above it. Then I want to hit the plus or minus buttons to change the part's quantity. Up to this point I have been able to use simple commands in VBA to update the value of a specific cell. I am in need though to try to find a linked command that will "hold" the current value of inventory and then will add or subtract a value of 1. I know the road to do this is the ActiveCell command but i don't want to use the actual value of inventory of a part. I want to select a part and link its current value as soon as i hit the here button.
Right up to this point I have reached the following level:
Private Sub CommandButton2_Click()
Me.Range("I5").Value = Me.Range("I5").Value + 1
End Sub
Private Sub CommandButton1_Click()
Me.TextBox1.Value = Selection
End Sub
Private Sub CommandButton3_Click()
Me.Range("I5").Value = Me.Range("I5").Value - 1
End Sub
These lines are connected with the updated value of a prespecified cell. The function in the middle "prints" a selected value into the textbox. How am i supposed to update the used parts cell (eg. cell I5), while selecting from the start the part in need, (eg. cell A5)? These lines are completely independent to each other.
Please, any suggestions would be much appreciated.
EDIT
Incorrect image removed
By selecting the part in need, I want to hit the here button. This will select the actual barcode of the item and will display it in the text box above it. Then I want to hit the plus or minus buttons to change the part's quantity. Up to this point I have been able to use simple commands in VBA to update the value of a specific cell. I am in need though to try to find a linked command that will "hold" the current value of inventory and then will add or subtract a value of 1. I know the road to do this is the ActiveCell command but i don't want to use the actual value of inventory of a part. I want to select a part and link its current value as soon as i hit the here button.
Right up to this point I have reached the following level:
Private Sub CommandButton2_Click()
Me.Range("I5").Value = Me.Range("I5").Value + 1
End Sub
Private Sub CommandButton1_Click()
Me.TextBox1.Value = Selection
End Sub
Private Sub CommandButton3_Click()
Me.Range("I5").Value = Me.Range("I5").Value - 1
End Sub
These lines are connected with the updated value of a prespecified cell. The function in the middle "prints" a selected value into the textbox. How am i supposed to update the used parts cell (eg. cell I5), while selecting from the start the part in need, (eg. cell A5)? These lines are completely independent to each other.
Please, any suggestions would be much appreciated.
EDIT
Incorrect image removed
Last edited by a moderator: