Hello All,
I am in need of some help in writing a macro to hide rows of a spreadsheet based on the outcome of a formula.
Here is the situation:
In a separate spreadsheet (within the same workbook) names "pricing and margin sheet" I have a number of input criteria. There is a piece of equipment listed in each column in the range of AG10:AW24. In the range AG24:AW24, each cell is a drop down list where you can select "yes" or "no." This input is used in a formula in the spreadsheet labeled "quote" that will determine id the row is populated or not.
In the spreadhseet "quote" there is a table with the range of B23:I50. The "yes" or "no" input from the "pricing and margin sheet" sheet dictates the outcome of the "quote" sheet range B23:B50. Here is the formula in that row.
=IF('pricing and margin sheet'!$AG$24='pricing and margin sheet'!$Q$12,"",'pricing and margin sheet'!$AG$16)
The cell Q12 contains "no." This formula means that if the input range in the "pricing and margin sheet" says "no," then the formula enters "", if the cell says anything other than "no", the formula will refer to cell AG16.
I need the macro to hide all rows where that formula (in range B23:B50) outputs a ""
Each row (between rows 23 and 50) should be hidden if the output of all formulas in range B23:B50 is "" (in other words, if the user selects "no" for all items).
Thank you!
I am in need of some help in writing a macro to hide rows of a spreadsheet based on the outcome of a formula.
Here is the situation:
In a separate spreadsheet (within the same workbook) names "pricing and margin sheet" I have a number of input criteria. There is a piece of equipment listed in each column in the range of AG10:AW24. In the range AG24:AW24, each cell is a drop down list where you can select "yes" or "no." This input is used in a formula in the spreadsheet labeled "quote" that will determine id the row is populated or not.
In the spreadhseet "quote" there is a table with the range of B23:I50. The "yes" or "no" input from the "pricing and margin sheet" sheet dictates the outcome of the "quote" sheet range B23:B50. Here is the formula in that row.
=IF('pricing and margin sheet'!$AG$24='pricing and margin sheet'!$Q$12,"",'pricing and margin sheet'!$AG$16)
The cell Q12 contains "no." This formula means that if the input range in the "pricing and margin sheet" says "no," then the formula enters "", if the cell says anything other than "no", the formula will refer to cell AG16.
I need the macro to hide all rows where that formula (in range B23:B50) outputs a ""
Each row (between rows 23 and 50) should be hidden if the output of all formulas in range B23:B50 is "" (in other words, if the user selects "no" for all items).
Thank you!