![]() |
|
#3
|
|||
|
|||
|
I believe this does what you're asking, although it doesn't match your after file.
Code:
Sub tomlam()
' remove rows with blank "C" and limit to 15
Dim lr As Long
Dim r As Long
Dim i As Integer
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
'delete rows where C is blank
Range("C1", Cells(Rows.Count, "C").End(xlUp)).SpecialCells(xlBlanks).EntireRow.Delete
'limit to 15
lr = Cells(Rows.Count, "C").End(xlUp).Row
For r = lr To 2 Step -1
If Cells(r, "C").Value = "total export" Then
i = 0
Else
i = i + 1
End If
If i > 15 Then Rows(r).Delete
Next r
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Getting the Count formula to count all rows
|
Jennifer Murphy | Word Tables | 11 | 08-23-2016 09:37 PM |
| How to Delete the same watermark that are in 300 slides. I cant dare to manually delete. | yeshwanthkota111 | PowerPoint | 0 | 09-05-2015 10:03 AM |
Delete starting number *) and delete Unneeded data in series
|
frustrated teacher | Word VBA | 5 | 12-07-2014 06:53 PM |
| Delete option greyed out when trying to delete row 1 | tpcervelo | Excel | 2 | 11-15-2011 06:48 AM |
| delete email message via blackberry and have it delete on my pop3 and my outlook | Iamthestorm | Outlook | 2 | 10-28-2010 12:21 AM |