Hi,
Please help. Am new with these vba codes. Am working with a table that has two columns. I would like to use vlookup to get the number of a cell in column two by looking up column one and then adding another number to that number. For instance, my combobox (cboPro) has a drop down and I select a value that is in cell A3. I need cell B3 (with a number 13) to increase from 13 to 27 when I type 14 into a textbox (txtQty).
what I find difficult to do is to know exactly how to add a value to the cell via a textbox on a userform.
Here is my code:
Private Sub cmdAdd_Click()
Dim ws As Worksheet
Set ws = Worksheets("ProductInformation")
txtQty.Value = Application.VLookup(cboPro.Value, Range("ProductTable"), 2, 0) + txtQty.Value
Please help. Am new with these vba codes. Am working with a table that has two columns. I would like to use vlookup to get the number of a cell in column two by looking up column one and then adding another number to that number. For instance, my combobox (cboPro) has a drop down and I select a value that is in cell A3. I need cell B3 (with a number 13) to increase from 13 to 27 when I type 14 into a textbox (txtQty).
what I find difficult to do is to know exactly how to add a value to the cell via a textbox on a userform.
Here is my code:
Private Sub cmdAdd_Click()
Dim ws As Worksheet
Set ws = Worksheets("ProductInformation")
txtQty.Value = Application.VLookup(cboPro.Value, Range("ProductTable"), 2, 0) + txtQty.Value