Hi all,
I am working on an Excel project for work in which I need to write a macro that, among other things, searches through a range of cells and returns the first cell that has a #DIV/0 error.
That range calculates a division of cells within a pivot table. If the pivot table has 5 rows of data for a given filter, the division range will have 5 rows of values, then multiple rows of #DIV/0. Based on the filter, the pivot table can have anywhere from 0 to 50 rows of values, which is the reason for the extra division cells.
The division range starts at I7 and theoretically goes through Range("I7").End(xlDown), so how do I go through each cell in that range, check if it holds a value or an error, and stop at the first cell that has an error?
Thanks in advance!
I am working on an Excel project for work in which I need to write a macro that, among other things, searches through a range of cells and returns the first cell that has a #DIV/0 error.
That range calculates a division of cells within a pivot table. If the pivot table has 5 rows of data for a given filter, the division range will have 5 rows of values, then multiple rows of #DIV/0. Based on the filter, the pivot table can have anywhere from 0 to 50 rows of values, which is the reason for the extra division cells.
The division range starts at I7 and theoretically goes through Range("I7").End(xlDown), so how do I go through each cell in that range, check if it holds a value or an error, and stop at the first cell that has an error?
Thanks in advance!