EntireRowBlank? Just cant make it work....

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Current code which does not work is as below:)

Please advice.
Thanks in advance.

Code:
[/FONT]
[FONT=Courier New]Option Explicit[/FONT]
[FONT=Courier New]Sub EntireRowBlank()
Dim lr As Long
Dim i As Range
lr = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
       
For Each i In Range("A1:A" & lr)
 If IsBlank(i.EntireRow) Then
  MsgBox "Yes"
 End If
Next i
End Sub
 
Well, like I said, this indicates that some of your blanks are not really blank...

Try this to flag rows that are NOT blank...

Rich (BB code):
Sub IreRowBlank()
Dim lr As Long
Dim i As Long
lr = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
 
For i = lr To 1 Step -1
If Application.CountBlank(Cells(i, "A").EntireRow) = Columns.Count Then
 Cells(i, "A").EntireRow.Delete
Else
 With Cells(i, Columns.Count).End(xlToLeft)
    .Offset(0,1).Value = "The Cell " & .Address & " Is Not Blank"
  End With
End If
Next i
End Sub
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Jon, works perfect now...
Really appriciate your help!:)

Thanks again guys!
Good night or day!
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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