Ray Erden
asked on
Print Range
I need to print a dynamically changing range. On the file attached I tried this using Sub named "DynamicPrintArea" assigned to Print button on "Cash Flow" worksheet but it cuts off on Year15 or just does not do it. Tried OFFSET function in named range but failed as well (=OFFSET(‘Cash Flow’!$B$10,,,COUNTA(‘Cash Flow’!$B$1:$B$55),COUNTA(‘ Cash Flow’!$B$1:$AZ$10))). The number of rows are static but number of years subject to change up to column AZ. I need to get this worked either using OFFSET function in the named range or via VBA procedure. The code behind the print button works well with another range with dynamic rows and tried to modifiy for this range without much luck. Once I clear the print area then click on Print then do print view it shows up to year 15. Help will be much appreciated, thanks. I put a formula in A54 currently displaying 24 for column count that VBA uses.
C--Users-rerden-Desktop-PrintRange.xlsm
C--Users-rerden-Desktop-PrintRange.xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried both solutions and both works, I prefer to use sktneer's method in VBA, but thank you both for help.
Glad I could help. :)
Open in new window