zookeepertx
Well-known Member
- Joined
- May 27, 2011
- Messages
- 560
- Office Version
- 365
- Platform
- Windows
I've been trying to figure this out on my own, but am just beating my head into a wall. So, I surrender & am hoping someone can tell me where my error is.
I have a report that shows data broken up into age ranges: 1-30 days, 31-60 days, etc. The age range info is found in column B. I want to delete the next 6 rows after each age range header. (All headers look like: Age Range: 0-30. No of recaps 23)
Here's what I've arrived at most recently (just one of many things I've tried), but it just runs through & doesn't actually DO anything. At least it doesn't give me any annoying error messages, so there's that.
If someone can show me this, I think I can figure out from there how to do the rest of what needs done on this report.
Thanks!
Jenny
I have a report that shows data broken up into age ranges: 1-30 days, 31-60 days, etc. The age range info is found in column B. I want to delete the next 6 rows after each age range header. (All headers look like: Age Range: 0-30. No of recaps 23)
Here's what I've arrived at most recently (just one of many things I've tried), but it just runs through & doesn't actually DO anything. At least it doesn't give me any annoying error messages, so there's that.
Code:
Sub ClearingTB()
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With
LR = Range("B" & Rows.count).End(xlUp).Row
LC = Cells(12, Columns.count).End(xlToLeft).Column
For i = 1 To LR
If Range("B" & i).Value = "Age Range:*" Then
Rows("i + 1 : i + 6").Delete
End If
Next i
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
End With
End Sub
If someone can show me this, I think I can figure out from there how to do the rest of what needs done on this report.
Thanks!
Jenny
Last edited: