View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Find next cell with more than 1024 characters

change just the main routine

from
Sub DisplayLongText()
'Adds line feed characters as required on cells in selection that are
longer than 1024 characters
Dim cel As Range
Dim col As Long
For Each cel In Selection
AddLineFeeds cel, col
Next
col = 0 'Force line length dialog to display the next time sub runs
End Sub

to
Sub DisplayLongText()
'Adds line feed characters as required on cells in selection that are
longer than 1024 characters
Dim cel As Range
Dim col As Long
For Each cel In Selection
if len(cel) 1024 then
AddLineFeeds cel, col
end if
Next
col = 0 'Force line length dialog to display the next time sub runs
End Sub


"Souriane" wrote:

Good morning all:

I have a table with a few cells with about 2000 characters each . Of
course, Excel will not show the text after 1024. I would like to do a
macro that would find the next cell with more than 1024 characters, in
order to format the cell with the macro found on this page:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=421

I could do it manually but it is a merged document and I remerge this
document at least once a week.

Any help?

Thank you!

Souriane