(Solved) – How to delete a row of data if none of the cells are misssing values?

  • by
(solved)-–-how-to-delete-a-row-of-data-if-none-of-the-cells-are-misssing-values?

I have a spreadsheet with sales data for a given month for a number of different stores. There are approximately 450 rows (stores) to go through. The days of the month are in row 1, starting in column B, with the store numbers in column A, starting in row 2. What I need to find are the rows that are missing data for different days. I can use conditional formatting to highlight the cells that are empty, but that is still a lot to look at. What I am trying to do is reduce the amount of cells to look at by deleting any rows that are not missing data. So if a row is not missing any days of data, then I don’t need to look at it, and can delete it. But if it is missing data, then keep the row. I’m stuck on figuring out the actual code, but I have come up with pseudo code for what I want:

foreach row in range ($B$2:$AB$450)
    foreach cell in row 
        if cell < 1
            delete row
    end foreach
end foreach

Here is an example of the spreadsheet:

        A           B               C               D
1               12/1/2019       12/2/2019       12/3/2019
2   Site 1          1000                            2000
3   Site 2          5000            5000            3000
4   Site 3          6000            4000            3000

In this example, rows 4 and 4 would be deleted because they are not missing any data.

Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *