Number Range Filter

PMARI

New Member
Joined
Jun 10, 2011
Messages
42
Hi Friends,

My sample data given below, I need to delete rows starting with "3" in column no.2 ORDERS. Recording Macro with number range filter is not working.

<table border="0" cellpadding="0" cellspacing="0" width="549"><col style="mso-width-source:userset;mso-width-alt:4644;width:95pt" width="127"> <col style="mso-width-source:userset;mso-width-alt:6253;width:128pt" width="171"> <col style="mso-width-source:userset;mso-width-alt:5156;width:106pt" width="141"> <col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> <tbody><tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt;width:95pt" height="20" width="127">Area</td> <td class="xl65" style="border-left:none;width:128pt" width="171">Order</td> <td class="xl65" style="border-left:none;width:106pt" width="141">Item</td> <td class="xl65" style="border-left:none;width:83pt" width="110">Order date</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;border-top:none" height="20">AA</td> <td class="xl66" style="border-top:none;border-left:none">101121</td> <td class="xl66" style="border-top:none;border-left:none">ROSE</td> <td class="xl67" style="border-top:none;border-left:none">01/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt;border-top:none" height="20">AA</td> <td class="xl68" style="border-top:none;border-left:none">300522</td> <td class="xl68" style="border-top:none;border-left:none">ROSE</td> <td class="xl69" style="border-top:none;border-left:none">02/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;border-top:none" height="20">PM</td> <td class="xl66" style="border-top:none;border-left:none">200012</td> <td class="xl66" style="border-top:none;border-left:none">LILLY</td> <td class="xl67" style="border-top:none;border-left:none">03/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt;border-top:none" height="20">SC</td> <td class="xl68" style="border-top:none;border-left:none">3000</td> <td class="xl68" style="border-top:none;border-left:none">LILLY</td> <td class="xl69" style="border-top:none;border-left:none">04/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;border-top:none" height="20">SC</td> <td class="xl66" style="border-top:none;border-left:none">101111</td> <td class="xl66" style="border-top:none;border-left:none">LOTUS</td> <td class="xl67" style="border-top:none;border-left:none">05/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;border-top:none" height="20">PM</td> <td class="xl66" style="border-top:none;border-left:none">140012</td> <td class="xl66" style="border-top:none;border-left:none">LILLY</td> <td class="xl67" style="border-top:none;border-left:none">06/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt;border-top:none" height="20">AA</td> <td class="xl68" style="border-top:none;border-left:none">362512</td> <td class="xl68" style="border-top:none;border-left:none">LILLY</td> <td class="xl69" style="border-top:none;border-left:none">07/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;border-top:none" height="20">AC</td> <td class="xl66" style="border-top:none;border-left:none">102547</td> <td class="xl66" style="border-top:none;border-left:none">LILLY</td> <td class="xl67" style="border-top:none;border-left:none">08/02/2011</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt;border-top:none" height="20">AC</td> <td class="xl68" style="border-top:none;border-left:none">300001</td> <td class="xl68" style="border-top:none;border-left:none">LOTUS</td> <td class="xl69" style="border-top:none;border-left:none">09/02/2011</td> </tr> </tbody></table>
Please guide me, any help highly appreciated.

Regards,PM.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try

Code:
Sub Delete3()
Dim LR As Long, i As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
    If Left(Range("B" & i).Value, 1) = "3" Then Rows(i).Delete
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,405
Members
452,911
Latest member
a_barila

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