Delete rows with no values in column E

saraereinosa

New Member
Joined
Jun 20, 2012
Messages
6
I have data like so:

00:01:18.941

<colgroup><col width="136"></colgroup><tbody>
</tbody>
Session begin

<colgroup><col width="133"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:18.941

<colgroup><col width="136"></colgroup><tbody>
</tbody>
63 Eyes Up

<colgroup><col width="133"></colgroup><tbody>
</tbody>
B= Slight

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:20.810

<colgroup><col width="136"></colgroup><tbody>
</tbody>
61 Eyes Left

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
63B

<colgroup><col width="68"></colgroup><tbody>
</tbody>
00:01:21.177

<colgroup><col width="136"></colgroup><tbody>
</tbody>
61 Eyes Left

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:21.177

<colgroup><col width="136"></colgroup><tbody>
</tbody>
63 Eyes Up

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:25.114

<colgroup><col width="136"></colgroup><tbody>
</tbody>
43 Eye Closure

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
63B

<colgroup><col width="68"></colgroup><tbody>
</tbody>
00:01:25.915

<colgroup><col width="136"></colgroup><tbody>
</tbody>
04 Brow Lowerer

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:25.915

<colgroup><col width="136"></colgroup><tbody>
</tbody>
09 Nose Wrinkle

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:26.215

<colgroup><col width="136"></colgroup><tbody>
</tbody>
04 Brow Lowerer

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
63B

<colgroup><col width="68"></colgroup><tbody>
</tbody>
00:01:26.215

<colgroup><col width="136"></colgroup><tbody>
</tbody>
09 Nose Wrinkle

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:26.349

<colgroup><col width="136"></colgroup><tbody>
</tbody>
43 Eye Closure

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
00:01:26.549

<colgroup><col width="136"></colgroup><tbody>
</tbody>
62 Eyes Right

<colgroup><col width="133"></colgroup><tbody>
</tbody>
E= Maximum

<colgroup><col width="153"></colgroup><tbody>
</tbody>
State start

<colgroup><col width="79"></colgroup><tbody>
</tbody>
63B

<colgroup><col width="68"></colgroup><tbody>
</tbody>

<tbody>
</tbody>

and I want to delete all rows that don't have data in the last column (ALWAYS COLUMN E IN EXCEL).

Does anyone know how to do this?

Thank you.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Code:
Sub delEblank()
Dim sh As Worksheet, lr As Long, rng As Range
Set sh = Sheets(1) 'Edit sheet name
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh.Range("E2:E" & lr)
For i = lr To 2 Step -1
If sh.Cells(i, 4) = "" Then
sh.Cells(i, 4).EntireRow.Delete
End If
Next
End Sub
Code:
 
Upvote 0
Shorter
Code:
Sub delEblank()
Dim i As Long
    For i = Sheets(1).Cells(Rows.Count, 5).End(xlUp).Row To 2 Step -1
        If Cells(i, 5) = "" Then Rows(i).Delete
    Next
End Sub
 
Upvote 0
yes mirabeau, I should have used that as well.....:oops:...too early in the morning for me !!!
 
Upvote 0

Forum statistics

Threads
1,216,389
Messages
6,130,323
Members
449,573
Latest member
bengee54

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