View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MichaB MichaB is offline
external usenet poster
 
Posts: 4
Default Insert Characters in cell with formatted text

Hello Community,

I've got a problem with a large Excel-Sheet filled mainly with text.
Each cell contains a formated text (bold, underline, color, ...) with
manual line-wraps (made with ALT-Enter). So far everything works fine,
but now I'm trying to add text to this cell. My first try was

cells(a,b).value =cells(a,b).value + NewText

This set all formats to the format of the first line of cell.

For the next approach I tried using the CHARACTERS-Property.

DLen = Worksheets("LOP").Range("F37").Characters.Count
Set DCh = Worksheets("LOP").Range("F37").Characters(DLen-1, 0)
DCh.Insert NewText

This worked perfectly, except that it only worked for cells with less
than 255 characters. Unfortunately most of the cells have more than 500
characters, even up to 2000 characters. With cells larger than 255
characters simply nothing happened.

Has anyone an idea how to add text to a large cell without destroying
the existing formats?

Thanks in advance.

MichaB