Blanchetdb
Board Regular
- Joined
- Jul 31, 2018
- Messages
- 161
- Office Version
- 2016
- Platform
- Windows
I presently have a code that will delete all rows if the cell value in column C is matching from data (Me.TxtPRI.Vaue) in a UserForm
Private Sub Update()
lr = .Range("C" & Rows.Count).End(xlUp).Row
For I = lr To 1 Step -1
If .Cells(I, "C") = CDbl(Me.TxtPRI.Value) Then .Rows(I).Delete
Next I
End Sub
How can I add to this code so that rows will only delete if specific information entered in combobox (MeTxtPRI.Value) AND combobox (Me.ListCity.Value) is found in Column C and Column N?
example: the person inserts on the UserForm their PRI: 12345698 and the City is Halifax.......all rows that have that PRI and City are deleted
thank you
Private Sub Update()
lr = .Range("C" & Rows.Count).End(xlUp).Row
For I = lr To 1 Step -1
If .Cells(I, "C") = CDbl(Me.TxtPRI.Value) Then .Rows(I).Delete
Next I
End Sub
How can I add to this code so that rows will only delete if specific information entered in combobox (MeTxtPRI.Value) AND combobox (Me.ListCity.Value) is found in Column C and Column N?
example: the person inserts on the UserForm their PRI: 12345698 and the City is Halifax.......all rows that have that PRI and City are deleted
thank you