ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete find "Grand Total" (https://www.excelbanter.com/excel-programming/292842-re-delete-find-grand-total.html)

Sue Harsevoort

Delete find "Grand Total"
 
That is because your have the offset(1,0) which is going to the row below
the grand total so you are only deleting the 3 rows under Grand Total and
not the row with the Grand Total. Take out the offset and change the resize
to 4,1 since you actually want to delete 4 rows total.

Sue

"Duncan J" wrote in message
...
I'm trying to Delete the row "Grand total" and the 3 rows below it. I

tried this but it's ot working.

Dim oFound As Range

Set oFound = Cells.Find("Grand Total")
If Not oFound Is Nothing Then
oFound.Offset(1, 0).Resize(3, 1).EntireRow.Delete
End If

Thanks a lot,
DJ





All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com