I'm at my wits end.
Given a certain row height, I'm trying to calculate how many rows I can fit on a printed page, and Excel is not giving me the answers I'm looking for.
Assume the following:
Page is set to A4 size (210mm x 297mm)
Top & bottom margins are bot set to 2.5cm
Row height is 12.75
The font of the normal style is set to Arial 10 pt.
When viewing in page break preview mode, I can fit 54 rows of height 12.75 on the page, and I can resize row 55 to max 22.75 pts before Excel inserts a page break.
Using the following code, I can determine that the space available to me between the top & bottom margins is 700.16 pts:
Now if I select rows 1 through 55, and get the Selection.Height value, Excel returns 711!
Now most people won't bat an eyelid over 11 points, but when you need things to line up precisely it's not negotiable. Also, depending on the row height of the bulk of the rows on the page, the difference between the two values also changes!
The madness doesn't here: If you change the size of the normal font style, you can resize the last row either higher or lower (it varies) before Excel throws in a page break! I know the normal style font has an influence on the column width, but surely not on the row height?
Don't let the tone of desperation fool you, I'm way past desperate :wink:
Regards,
Janco
Given a certain row height, I'm trying to calculate how many rows I can fit on a printed page, and Excel is not giving me the answers I'm looking for.
Assume the following:
Page is set to A4 size (210mm x 297mm)
Top & bottom margins are bot set to 2.5cm
Row height is 12.75
The font of the normal style is set to Arial 10 pt.
When viewing in page break preview mode, I can fit 54 rows of height 12.75 on the page, and I can resize row 55 to max 22.75 pts before Excel inserts a page break.
Using the following code, I can determine that the space available to me between the top & bottom margins is 700.16 pts:
Code:
Application.CentimetersToPoints(29.7 - 2.5 - 2.5) '--Page height excl. margins
Now if I select rows 1 through 55, and get the Selection.Height value, Excel returns 711!
Now most people won't bat an eyelid over 11 points, but when you need things to line up precisely it's not negotiable. Also, depending on the row height of the bulk of the rows on the page, the difference between the two values also changes!
The madness doesn't here: If you change the size of the normal font style, you can resize the last row either higher or lower (it varies) before Excel throws in a page break! I know the normal style font has an influence on the column width, but surely not on the row height?
Don't let the tone of desperation fool you, I'm way past desperate :wink:
Regards,
Janco