delete row if cell in range is empty

johnmpc

Board Regular
Joined
Oct 19, 2020
Messages
108
Office Version
  1. 365
Platform
  1. Windows
Hi,

Probably a really easy one.

I just want to delete rows in the range 15:31 if Column "i" is "0" in that range. Column i is the Qty. when copied across it looks empty but is actually 0.

This will be run automatically when the sheet is opened.
Thanks

Customer Name
#N/A​
Email:
#N/A​
CompanyPhone No:
Address
#N/A​
#N/A​
Mobile No:
#N/A​
#N/A​
#N/A​
Order GP%
Total Profit
Total Not Inc VAT
Total including VAT
CodeSupplierProduct DescriptionColourCost (Min)DecorationSellGP%QTYOne SizeSMLDecoration 1Position 1Decoration 2Position 2
Orn3200ORNAlbatross Classic FleeceNavy
£7.10​
£1.25​
£15.00​
44.33%​
20​
10​
10​
2MAN01Left Chest
ORN1000ORNPlover Premium T-ShirtNavy
£1.90​
£1.25​
£5.25​
40.00%​
15​
15​
2MAN01Left Chest
PENbb45PencarrieB/field Original Cuffed BeanieFrench Navy
£1.35​
£1.25​
£5.75​
54.78%​
10​
10​
2MAN01Centre Front
IT097474NewittsNIKE PARK 20 SENIOR WINTER JACKETObsidian
£66.63​
£2.00​
£110.00​
36.11%​
3​
3​
2MAN01Left ChestInitials PrintRight Chest
2111036United BrandsBrinkley ParkaNavy
£77.90​
£2.00​
£136.00​
38.31%​
1​
1​
2MAN01Left ChestInitials PrintRight Chest
PENbb45PencarrieB/field Original Cuffed Beaniemustard
£1.35​
£1.00​
£7.00​
66.43%​
PENbb45PencarrieB/field Original Cuffed Beanieblack
£1.35​
£1.00​
£7.00​
66.43%​
PENGD05PencarrieGildan Heavy Cotton Tred
£1.97​
£2.00​
£8.00​
50.38%​
9​
5​
4​
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Worked it out. Thanks to Joe4 for the previous.

Sub Delete2()

Dim r As Long

Application.ScreenUpdating = False

For r = 31 To 15 Step -1
If Cells(r, "i").Value = "0" Then Rows(r).delete
Next r

Application.ScreenUpdating = True

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,374
Messages
6,124,574
Members
449,173
Latest member
Kon123

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