Set in my program:
MyRng. WrapText = true; // wrap automatically
MyRng. entireRow. autoFit (); // The Row Height is automatically adjusted based on the content. After this setting, the page is displayed incorrectly. For example, if a page is 500 high, if the last line does not wrap automatically, it will appear on this page, but after the line breaks automatically, it is a line that spans two pages, or how can we get the line height after the line breaks automatically, could you help me?
The top line of EXCEL contains "format"-"line"-"most suitable row height". If you want to make automatic adjustment for all rows, select one. (The premise is that you can adjust the line feed after the line feed is completed. If the line feed is automatically adjusted first, it will not work !)
The CELL height can be known (Cell. rowHeight) Ah, before printing, read the CELL height of each row from the beginning, calculate it, and re-set the print. the above is the answer to your question, but I think it is not good. recommendation: 1. Set the print range. When there is a line break that exceeds the print line, EXCEL will print your entire line to the next page. 2. Set the print proportion, adjust the margin, and try to consider the occurrence of line breaks.