Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need to replace hard return with <br in excel file.
Triede to search and replace for hexadecimal value for hard return (0D 0A) like: Cells.find(What:="&HoD+&H0A", . Won't work. Any ideas or suggestions are appreciated. Regards Lars Christensen. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are actually searching for the string "&H0D+&H0A" instead of a carriage
return. Use Chr() to get the string representation of a Hex value (e.g. Chr(&H0D) & Chr(&H0A)), a more useful way for a carriage return or line feed or both is to use the constants provided with VBA (vbCr - Carriage Return, vbLf - Line Feed, vbNewLine or vbCrLf - combination of both). so Cells.Find(What:=vbCrLf,.... When you enter a carriage return directly into excel (using Alt+Enter) the actual code used is just a line feed so you will need to use Cells.Find(What:=vbLf,... Hope this is useful. Alan "Lars Christensen" wrote in message ... Need to replace hard return with <br in excel file. Triede to search and replace for hexadecimal value for hard return (0D 0A) like: Cells.find(What:="&HoD+&H0A", . Won't work. Any ideas or suggestions are appreciated. Regards Lars Christensen. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It actually worked! I have been working late with this
problem the last couple of days - and your suggestion worked perfect. I will sleep a lot better tonight - thank you. Lars. -----Original Message----- You are actually searching for the string "&H0D+&H0A" instead of a carriage return. Use Chr() to get the string representation of a Hex value (e.g. Chr(&H0D) & Chr(&H0A)), a more useful way for a carriage return or line feed or both is to use the constants provided with VBA (vbCr - Carriage Return, vbLf - Line Feed, vbNewLine or vbCrLf - combination of both). so Cells.Find(What:=vbCrLf,.... When you enter a carriage return directly into excel (using Alt+Enter) the actual code used is just a line feed so you will need to use Cells.Find(What:=vbLf,... Hope this is useful. Alan "Lars Christensen" wrote in message ... Need to replace hard return with <br in excel file. Triede to search and replace for hexadecimal value for hard return (0D 0A) like: Cells.find(What:="&HoD+&H0A", . Won't work. Any ideas or suggestions are appreciated. Regards Lars Christensen. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Import hexadecimal data into excel keeping hexadecimal format | Excel Discussion (Misc queries) | |||
Decimal to Hexadecimal | Excel Discussion (Misc queries) | |||
Problem opening csv files with hexadecimal values | Excel Discussion (Misc queries) | |||
Search multiple values to return single values | Excel Worksheet Functions | |||
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in | Excel Programming |