>Naomi
>
>Thanks for your response. However, I have tried to follow the logic but cannot.
>Also I cannot directly test it using copy-paste since I still use VFP6 which does not support TRY CATCH statements. I hope you wont mind explaining this logic line-by-line. Also what I am actually interested in is not the WIDEST entry but whether or not a numeric cell will be displayed as ###### due to less column width.
>
>Fred
For numeric columns AutoFit is usually enough. In my sample I tried to set width to 240 (looks like it's close to maximum) if the width was greater than 15 after AutoFit. I did it because I needed to put Excel into DBF and my long description fields were truncated otherwise.
If it's not broken, fix it until it is.
My Blog