View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joe HM Joe HM is offline
external usenet poster
 
Posts: 92
Default Truncating trailing Chr(10) in Cell w/ Len() 256 w/o losing Format ...

Hello -

I need to truncate trailing Chr(10)s from a cell that contains more
than 256 characters. The following will not work in that case ...

If Mid(ActiveSheet.Cells(1, 1).Value, Len(ActiveSheet.Cells(1,
1).Value)) = Chr(10) Then
ActiveSheet.Cells(1, 1).Characters(Start:=Len(ActiveSheet.Cells(1,
1).Value), Length:=1).Delete
End If

.... if the cell contains more than that limit. I know that I could
use the Cells().Value to do this but then I would lose all the
formatting within that cell (e.g. bolded words).

Is there any way to do this withoug losing the formatting?

Thanks!
Joe