Below is the code you advised me earlier for Column C and Column E.
Sub Del_Rows()
Dim a, b
Dim nc As Long, i As Long, k As Long
Dim s As String
nc = Cells.Find(What:="*", After:=Cells(1, 1), LookIn:=xlValues, SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, SearchFormat:=False).Column + 1
a = Range("C1", Range("E" & Rows.Count).End(xlUp)).Value
ReDim b(1 To UBound(a), 1 To 1)
For i = 1 To UBound(a)
s = LCase(a(i, 1) & "|" & a(i, 3))
Select Case True
Case s Like "*tablet*", s Like "*capsule*"
k = k + 1
b(i, 1) = 1
End Select
Next i
If k > 0 Then
Application.ScreenUpdating = False
With Range("A1").Resize(UBound(a), nc)
.Columns(nc).Value = b
.Sort Key1:=.Columns(nc), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
.Resize(k).EntireRow.Delete
End With
Application.ScreenUpdating = True
End If
End Sub
__________________________________________________
Below is the dummy data:
Column A | Column B | Column C | Column D | Column E | Column F | Column G |
21 Jan | 2371.1234 | Item 1 | Company | Supplier | Origin | 12 |
22 Jan | 3905.9990 | Item 2 | Company | Supplier | Origin | 1500 |
23 Jan | 3905.2632 | Item 3 | Company | Supplier | Origin | 650 |
24 Jan | 1702.1110 | Item 4 | Company | Supplier | Origin | 10 |
<tbody>
</tbody>
I want to delete those rows having value less than 20 in Column G.