I have a somewhat specific question. I hope you can help me
I have a worksheet that contains a table called "Activities". I have some form controls to fill in the same but I came up with the need to insert and delete rows from this table without interfering with the cells next to it. Filling a new row in the table without affecting the cells on the side is no problem, I've already been able to do that. The problem is being delete the row of the column that contains the added value (only the last one). Follow the images to illustrate what I intend to do.
Whenyouclickthe+buttonfor"Answered Calls", it adds a line in the "Activities" table with the text "Phone Answer".
I would like to be able to do the same thing with the minus button, when clicking on it, the last line containing "Telephone Answer" is deleted (only the last one inside the table), but not interfering with cells with the rectangle in blue.
Is there a way? As you can see, I already have a control that can delete the last row of the table, I use this code to do this:
Private Sub RemoveLinha_Click()
Dim i As Integer
i = ActiveSheet.ListObjects("Atividades").Range.Rows.Count
If i > 2 Then
Range("D" & i).ListObject.ListRows(i - 1).Delete
End If
End Sub
However, I do not know how to identify only the last value containing the specific text for each minus button I add.