Pick Another word

Np72

Board Regular
Joined
Dec 22, 2010
Messages
108
Hi,

I have this coding (which I've modified for my own purpose) and I wanted to add more words i.e. current Account (Vm) and Current account (VI). I've gone down the road of filtering then deleting but it just looks........messy ! Is there a way of adding these 2 current Account (Vm) and Current account (VI) into the coding.

Many Thanks

Sub FindAndRemove()
Dim i As Long
Dim j As Long
Dim pickWord As Variant
Dim pickAnother As Variant
pickWord = "margin"
pickAnother = "standard class"

For i = 2 To Range("B" & Rows.Count).End(xlUp).Row
Set w = Range("B" & i).Find(pickWord, LookIn:=xlValues)
Set y = Range("B" & i).Find(pickAnother, LookIn:=xlValues)
If w Is Nothing And y Is Nothing Then
Rows(i).EntireRow.Delete
If Range("B" & i) = "" Then Exit Sub
i = i - 1
End If
Next i


End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,217,358
Messages
6,136,093
Members
449,991
Latest member
IslandofBDA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top