BeginnerInExcel
New Member
- Joined
- Aug 18, 2022
- Messages
- 1
- Office Version
- 2013
- Platform
- Windows
Hi Excel Wizards,
I've set up a new sheet that will act as monitoring sheet with criteria going across to column I. Based on the value in one cell (C6), the sheet will populate the below rows with dates. Column A populates with a Day number (0,1,2,3 etc) and Column B with the actual date. In order to do this columns A & B are therefore populated with formulas for generating the dates down to day 210.
The problem I have is that when I come to print. If we have need for a 7 day monitoring task, the spreadsheet will print a large number of pages when only 1 would be needed. This is I assume because there are formulas in all cells down to around 250. I would like to be able to have a print button that will run a macro that prints from the computers default printer and only prints pages on the sheet that have date values on them to save all the excess paper.
To aid this I've got a cell (I2) with the following formula that acts a page count for required number of pages to print.
=IF(C6="","",IF(C6>192,5,IF(C6>139,4,IF(C6>86,3,IF(C6>33,2,IF(C6>0,1))))))
While I'm ok with Excel formulas, VBA is an unknown to me and I have no idea how to get a macro that takes the value in cell I2 and translates that into an instruction to print that number of pages when clicking a print button. Any help that can be given would be appreciated!
A complete VBA novice.
I've set up a new sheet that will act as monitoring sheet with criteria going across to column I. Based on the value in one cell (C6), the sheet will populate the below rows with dates. Column A populates with a Day number (0,1,2,3 etc) and Column B with the actual date. In order to do this columns A & B are therefore populated with formulas for generating the dates down to day 210.
The problem I have is that when I come to print. If we have need for a 7 day monitoring task, the spreadsheet will print a large number of pages when only 1 would be needed. This is I assume because there are formulas in all cells down to around 250. I would like to be able to have a print button that will run a macro that prints from the computers default printer and only prints pages on the sheet that have date values on them to save all the excess paper.
To aid this I've got a cell (I2) with the following formula that acts a page count for required number of pages to print.
=IF(C6="","",IF(C6>192,5,IF(C6>139,4,IF(C6>86,3,IF(C6>33,2,IF(C6>0,1))))))
While I'm ok with Excel formulas, VBA is an unknown to me and I have no idea how to get a macro that takes the value in cell I2 and translates that into an instruction to print that number of pages when clicking a print button. Any help that can be given would be appreciated!
A complete VBA novice.