Hi
Sorry my mistake
heres the code hope someone can helpme
Code:Sub StockIn() If ComboBox1.Value = vbNullString Then 'if the user has yet to search for the record then 'provide the user with a msgbox asking them to search for the record first MsgBox "Tem de fazer primeiro a escolha do produto para dar entrada de stock.", vbOKOnly, "Please Read" Else 'if the combobox has a value then With Sheets(ComboBox1.Value) 'with the worksheet whose name is equal to combobox1's value 'so the cell in found cell's row, column G(New Stock) is equal to the .Cells(Range("A2").Value, 7) = .Cells(Range("A5").Value, 7) + Range("L5").Value End With 'provide message box letting user know the values have been updated MsgBox "Stock actualizado", vbOKOnly, "StockIn" End If End Sub Sub StockOut() If ComboBox1.Value = vbNullString Then 'if the user has yet to search for the record then 'provide the user with a msgbox asking them to search for the record first MsgBox "Tem de fazer primeiro a escolha do produto para dar saida de stock.", vbOKOnly, "Please Read" Else 'if the combobox has a value then With Sheets(ComboBox1.Value) 'with the worksheet whose name is equal to combobox1's value 'so the cell in found cell's row, column G(New Stock) is equal to the .Cells(Range("A5").Value, 7) = .Cells(Range("A5").Value, 7) - Range("L8").Value End With 'provide message box letting user know the values have been updated MsgBox "Stock actualizado", vbOKOnly, "StockOut" End If End Sub




Reply With Quote