I want automatically to hide rows that contain no data just before printing.
A cell in the row to be hidden in Sheet 2 contains the formula: =IF(Sheet1!A15=0,"",Sheet1!A15) so we need to look at the result and not that the cell contains nothing. Users will enter figures on Sheet 1 which are then formatted and totalled on Sheet 2.
If cells A15 and A16 on Sheet 1 are left blank, I want the corresponding rows (not necessarily rows 15 and 16) in Sheet 2 to reduce to zero width.
I think I need a macro with a series of If Then operations but have been struggling with my very basic knowledge of VBA.
Users might need to go back later and put information in A15 or A16 or both so the macro would have to unhide (and preferably autofit the relevant rows in Sheet 2) when run again. I would also like to restore normal row heights to the rows on Sheet 2 on exit from the worksheet.
A cell in the row to be hidden in Sheet 2 contains the formula: =IF(Sheet1!A15=0,"",Sheet1!A15) so we need to look at the result and not that the cell contains nothing. Users will enter figures on Sheet 1 which are then formatted and totalled on Sheet 2.
If cells A15 and A16 on Sheet 1 are left blank, I want the corresponding rows (not necessarily rows 15 and 16) in Sheet 2 to reduce to zero width.
I think I need a macro with a series of If Then operations but have been struggling with my very basic knowledge of VBA.
Users might need to go back later and put information in A15 or A16 or both so the macro would have to unhide (and preferably autofit the relevant rows in Sheet 2) when run again. I would also like to restore normal row heights to the rows on Sheet 2 on exit from the worksheet.