ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to check if cell contents overflow. (https://www.excelbanter.com/excel-programming/311871-how-check-if-cell-contents-overflow.html)

Alan Savage

How to check if cell contents overflow.
 
Hi,

Does anyone know how to find out if the contents of a cell in a Excel
Worksheet overflow in the cell? Using string length does not work ideally as
some characters take up more room than others.

TIA

Alan



Tom Ogilvy

How to check if cell contents overflow.
 
If it is the longest string in the column.
record the column width, then autofit the column - record the width, then
restore the old width. Compare the old width to the autofit width. It the
autofit width is larger.

Otherwise, you might have to create a dummy sheet. Copy over the cell and
perform the above test, then delete the sheet. Beyond that, I think you
would need to get into some heavy API work.

--
Regards,
Tom Ogilvy

"Alan Savage" wrote in message
...
Hi,

Does anyone know how to find out if the contents of a cell in a Excel
Worksheet overflow in the cell? Using string length does not work ideally

as
some characters take up more room than others.

TIA

Alan






All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com