Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50094

Delete rows containing "0" across an unspecified number of Columns

$
0
0
Good evening,

I need help in creating a macro that deletes rows containing zeros across an unspecified number of columns. I have to analyze financial statements/reports on a daily basis which can range anywhere between 1,000 to 10,000 rows of data. The number of columns also changes depending on the report I’m working with, because of this I cannot specify a column for reference in the code as each report is unique in its own way.

Attached is the sample workbook I've been using to test a macro, for your reference. The workbook has the macro started, although it only contains the code to find and select the range of cells with data as I have been unsuccessful in writing the finishing code. I would like to keep this code as part of the final macro as it is very accurate in selecting the actual range of data, but it’s not mandatory.

Two things I would like the code to accomplish (#1 being the most important, #2 if possible):

1.Delete all rows containing zeros across the selected range (all columns), i.e. Row 10, 11, 12 and so forth, of the attached workbook.
2.Delete rows of department titles which contain no data beneath it. Example would be lines 21 & 22 of the workbook. Line 22 would be deleted with the first argument above, but line 21 would remain which will create confusion.

Any help is greatly appreciated. Thank you!

Viewing all articles
Browse latest Browse all 50094

Trending Articles