delete rows with blank cell

Godders199

Active Member
Joined
Mar 2, 2017
Messages
313
Office Version
  1. 2013
Hello, I have written the following code to delete all rows where the cell in column J is Blank, but currently it is deleting all rows

Dim uLastRow As Long
Dim u As Long
uLastRow = Cells(Rows.Count, "d").End(xlUp).Row
For u = uLastRow To 1 Step -1
If Cells(u, "j").Value = "" Then
Rows(u).Delete
End If
Next u

I do have column A hidden, but even unhiding that has the same result. is there any reason why it is deleting all rows?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
hi, no merged cells, the following formula is in column J, so is it just not seeing the "match" and deleting all?

=IF(COUNTIFS('Outstanding 2ndline'!A:A,HFC!D2)>0,"match","")
 
Upvote 0
Hi, have just worked out if i do this as a separate marco , it works, just does not work when combined with the formatting and adding the above formula.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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