ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro - Delete Rows with specific text (https://www.excelbanter.com/excel-programming/445616-macro-delete-rows-specific-text.html)

Umesh Banga

Macro - Delete Rows with specific text
 
Hi,

I want have the following types of table

Total Inflow 82,437 25,921 26,294 27,272 28,455


Cheryl 0 0 0 0 0
Pension 0 0 0 0 0
Total Outflow 81,475 25,625 26,275 26,925 27,600

I want to delete the rows which includes all zeros - can someone please tell me the coding of doing this. Note- in the above table row starting with "cheryl" and "pension" should be deleted.

isabelle

Macro - Delete Rows with specific text
 
hi,

Sub Macro1()
For i = Range("A65536").End(xlUp).Row To 2 Step -1
If Range("A" & i) < "" And Application.Sum(Range("B" & i & ":IV" & i)) = 0 Then Rows(i).Delete Shift:=xlUp
Next
End Sub



--
isabelle



Le 2012-03-28 19:50, Umesh Banga a écrit :
Hi,

I want have the following types of table

Total Inflow 82,437 25,921 26,294 27,272 28,455


Cheryl 0 0 0 0 0
Pension 0 0 0 0 0
Total Outflow 81,475 25,625 26,275 26,925 27,600

I want to delete the rows which includes all zeros - can someone please
tell me the coding of doing this. Note- in the above table row starting
with "cheryl" and "pension" should be deleted.





Umesh Banga

Thanks Isabelle, you are champion. It works perfectly well.

I was wondering if you have something like this for MS WORD.


Quote:

Originally Posted by isabelle (Post 1600300)
hi,

Sub Macro1()
For i = Range("A65536").End(xlUp).Row To 2 Step -1
If Range("A" & i) < "" And Application.Sum(Range("B" & i & ":IV" & i)) = 0 Then Rows(i).Delete Shift:=xlUp
Next
End Sub



--
isabelle



Le 2012-03-28 19:50, Umesh Banga a écrit :
Hi,

I want have the following types of table

Total Inflow 82,437 25,921 26,294 27,272 28,455


Cheryl 0 0 0 0 0
Pension 0 0 0 0 0
Total Outflow 81,475 25,625 26,275 26,925 27,600

I want to delete the rows which includes all zeros - can someone please
tell me the coding of doing this. Note- in the above table row starting
with "cheryl" and "pension" should be deleted.






All times are GMT +1. The time now is 02:43 PM.

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