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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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