View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stopfordian Stopfordian is offline
external usenet poster
 
Posts: 2
Default Selection.Replace size limitation

I have Excel 2002, SP-2.

If the text cell selected is big in length, the code below does not work.

Sub Trim10()
Dim cell As Range
Selection.Replace What:=Chr(10), replacement:=Chr(32), _
lookat:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End Sub

The longest length which worked was 945 but some which are less than that
also did not work for some reason. Under 900 and it looks as thought it
always works. I can confirm that the ones which haven't worked do contain
Chr(10).
Is there anything I can do to fix this size limitation?

Thanks
--
http://www.takesyourfancy.co.uk/ - Great products and great prices for all
the family