View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default How to limit long text to column width?

You can check each adjacent cell and if empty add an apostrophe
or a space in it....
If len(rCell.Offset(0, 1).Value) = 0 then rCell.Offset(0, 1).Value = "'"
Or you could use SpecialCells and find all blanks in the adjoining
column and add the same.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




wrote in message
I have a VBA function that returns a very long string. If the
adjacent cell is blank, the display of the string extends past the
cell boundary. If the adjacent is nonblank, the display of the string
stops at the cell boundary.

How can I get the latter behavior even when the adjacent cell is
blank?

I don't want to truncate the string value, just the display of it.
That is, LEFT() is not a solution for me.