Hi,
I'm working in a inventory system and i'm using a userform to add and delete data in a specific table containing all the information.
Right now i was able to make a macro to add information to the last blank cell of the table.
Now, what i need to know is, how can i delete data from the table using only the information in the "SKU" field of the userform?
EXAMPLE: If i have "1234" in the SKU field, and press "DELETE", the userform will search for "1234" in the table and erase that line.
Thanks in advance.
I'm working in a inventory system and i'm using a userform to add and delete data in a specific table containing all the information.
Right now i was able to make a macro to add information to the last blank cell of the table.
Code:
Private Sub CommandButton1_Click() Dim rng As Range
Set rng = Sheets("LISTAGEM").ListObjects("Table1").Range
Dim LastRow As Long
LastRow = rng.Find(What:="*", _
After:=rng.Cells(1), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
rng.Parent.Cells(LastRow + 1, 1).Value = TextBox2.Value
rng.Parent.Cells(LastRow + 1, 2).Value = TextBox3.Value
MsgBox "Portátil Adicionado"
If TextBox2.Text = "" Then
MsgBox "Inserir EAN no campo indicado!"
End If
End Sub
Now, what i need to know is, how can i delete data from the table using only the information in the "SKU" field of the userform?
EXAMPLE: If i have "1234" in the SKU field, and press "DELETE", the userform will search for "1234" in the table and erase that line.
Thanks in advance.