Hi,
I have a range of cells that are fixed in size (the row height / column width cannot change). The text string that goes into each cell is variable and could have anywhere from 10 to 150 characters in it. The cells are currently set for wrapped text with a font size 14 which satisfies most of the text that goes into the cells. However when the text string increases in character count it is not always completely visible in every cell. Is there any code that will choose the optimum font size to display the wrapped text clearly and fill the cell as much as possible (at 100% page zoom)? I have used the code below for other jobs but it's clunky, requires lots of thresholds, and is not accurate as characters vary in size.
Any help much appreciated.
Rgds,
I have a range of cells that are fixed in size (the row height / column width cannot change). The text string that goes into each cell is variable and could have anywhere from 10 to 150 characters in it. The cells are currently set for wrapped text with a font size 14 which satisfies most of the text that goes into the cells. However when the text string increases in character count it is not always completely visible in every cell. Is there any code that will choose the optimum font size to display the wrapped text clearly and fill the cell as much as possible (at 100% page zoom)? I have used the code below for other jobs but it's clunky, requires lots of thresholds, and is not accurate as characters vary in size.
Any help much appreciated.
Rgds,
Code:
For Each c In Range("MP318:MP417")
Select Case Len(c)
Case 0 To 40
c.Font.Size = 14