Macro: Deleting Rows based on values in 2 columns

jmstev32

New Member
Joined
Feb 25, 2013
Messages
21
I have an excel sheet that has 11 columns just as follows:

[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]PLU[/TD]
[TD]Description[/TD]
[TD]Dept[/TD]
[TD]UOM[/TD]
[TD]Cost[/TD]
[TD]Retail[/TD]
[TD]Margin[/TD]
[TD]Inv[/TD]
[TD]Sales[/TD]
[TD]Sales2nd[/TD]
[TD]Supply[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]Jack Dan[/TD]
[TD]135[/TD]
[TD]750[/TD]
[TD]1.11[/TD]
[TD]1.99[/TD]
[TD]22.14[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]20151[/TD]
[TD]Cuervo[/TD]
[TD]136[/TD]
[TD]750[/TD]
[TD]1.13[/TD]
[TD]1.99[/TD]
[TD]22.51[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]50364[/TD]
[TD]Jim Beam [/TD]
[TD]136[/TD]
[TD]175[/TD]
[TD]1.43[/TD]
[TD]2.49[/TD]
[TD]22.54[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]


I am wanting to create a macro that will either automatically delete or a macro I can create a button to initiate that will delete every row that has a 0 in columns H (Inv), I (Sales) and (Sales2nd). A 0 has to appear in ALL THREE columns in order for me to want to delete it.

My rows will only go up to row 2500.

I am very much so a beginner when it comes to macros and have only had success so far with sorting and deleting specific numbers of rows. So if anyone can help me get gain a little bit more knowledge that would be great! Thanks for all your help in advance!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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