ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Limitation of Find and Replace Text in Excel (https://www.excelbanter.com/excel-programming/310251-limitation-find-replace-text-excel.html)

wolfteeth

Limitation of Find and Replace Text in Excel
 
I am trying to reformat some data in Excel to make some downloade
information more easily readable. The information to be manipulated i
a. In the download the different items of History are joined togethe
with a | delimiter to produce a long wrap around string.

I have an Excel macro which finds the | delimiter in the string an
converts this to a line break (i.e. vbLF or Alt+Enter). The expecte
result is that wherever | occurs, subsequent text is pushed to a ne
line.

I have found that the macro worked perfectly if the length of th
string does not exceed 911 characters. It failed if the length of th
string exceeded 911 characters.

would appreciate it if you could help investigate this further t
determine if there is something in our macro which has triggered th
lower limits.

I attach the following:
-
Sub Macro1()
ActiveWindow.ActivateNext
Cells.Select
Selection.Replace What:="|", Replacement:=vbLf, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
_
ReplaceFormat:=False
End Sub
-
Look forward to your advice after testing

Best regard

Attachment filename: reformatter2.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=69728
--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

Limitation of Find and Replace Text in Excel
 
See a couple of replies at your other post.

"wolfteeth <" wrote:

I am trying to reformat some data in Excel to make some downloaded
information more easily readable. The information to be manipulated is
a. In the download the different items of History are joined together
with a | delimiter to produce a long wrap around string.

I have an Excel macro which finds the | delimiter in the string and
converts this to a line break (i.e. vbLF or Alt+Enter). The expected
result is that wherever | occurs, subsequent text is pushed to a new
line.

I have found that the macro worked perfectly if the length of the
string does not exceed 911 characters. It failed if the length of the
string exceeded 911 characters.

would appreciate it if you could help investigate this further to
determine if there is something in our macro which has triggered the
lower limits.

I attach the following:
-
Sub Macro1()
ActiveWindow.ActivateNext
Cells.Select
Selection.Replace What:="|", Replacement:=vbLf, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False
End Sub
-
Look forward to your advice after testing

Best regards

Attachment filename: reformatter2.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=697280
---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com