I posted this in the Office Forum, but I think it may be better suited to this forum. While I am not a programmer, and I am sure there are much better ways to complete this task, here is what I have done.
I need to print a report that may be 1 to 5 pages in length. The data for the report is to be displayed in a template that I have created in columns ek thru ez. I have copied the template five times so that it extends from ek2 to ez286. There aren't any empty rows between the pages. Page 1 ends on row 58, while page two starts on row 59.
I calculate the results for the report, and move them to the templates for the total length that is necessary. I have the number of pages stored in EI6 and based on the value of EI6, I have the last row of the desired print range stored in EI14. I even used concatenate to store the print range in EI16 (example of EI16: =concatenate("EK2:EZ",$EI$14) resulting in EK2:EZ229 if four pages in length)
Length Range
1 Page EK2:EZ58
2 Pages EK2:EZ115
3 Pages EK2:EZ172
4 Pages EK2:EZ229
5 Pages EK2:EZ286
The report will always be portrait, 1 page wide, and printed on letter size paper in black and white (I have used Color for shading). Currently, to fit on the page properly, each page must be scaled to 97% of its normal size.
How do I establish the print range based on the result contained in either EI6 (number of pages)or EI14 (last row of print range)? Given the scaling need, do I create a loop from 1 to (x pages) and print each page individually? Do you establish the print range and set page breaks at rows 58,115,172 and so on? Do I attempt to resize the template so that at normal size, there would be no scaling necessary? So many questions, and yet so little knowledge. HELP!!
Also, this is my first attempt at creating an Excel Macro using VBA (I would like my first time to be a pleasant experience)
Thanks in advance for your help.
I need to print a report that may be 1 to 5 pages in length. The data for the report is to be displayed in a template that I have created in columns ek thru ez. I have copied the template five times so that it extends from ek2 to ez286. There aren't any empty rows between the pages. Page 1 ends on row 58, while page two starts on row 59.
I calculate the results for the report, and move them to the templates for the total length that is necessary. I have the number of pages stored in EI6 and based on the value of EI6, I have the last row of the desired print range stored in EI14. I even used concatenate to store the print range in EI16 (example of EI16: =concatenate("EK2:EZ",$EI$14) resulting in EK2:EZ229 if four pages in length)
Length Range
1 Page EK2:EZ58
2 Pages EK2:EZ115
3 Pages EK2:EZ172
4 Pages EK2:EZ229
5 Pages EK2:EZ286
The report will always be portrait, 1 page wide, and printed on letter size paper in black and white (I have used Color for shading). Currently, to fit on the page properly, each page must be scaled to 97% of its normal size.
How do I establish the print range based on the result contained in either EI6 (number of pages)or EI14 (last row of print range)? Given the scaling need, do I create a loop from 1 to (x pages) and print each page individually? Do you establish the print range and set page breaks at rows 58,115,172 and so on? Do I attempt to resize the template so that at normal size, there would be no scaling necessary? So many questions, and yet so little knowledge. HELP!!
Also, this is my first attempt at creating an Excel Macro using VBA (I would like my first time to be a pleasant experience)
Thanks in advance for your help.