Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search for hexadecimal values

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Search for hexadecimal values

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Search for hexadecimal values

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import hexadecimal data into excel keeping hexadecimal format Whale Excel Discussion (Misc queries) 1 February 24th 10 08:23 AM
Decimal to Hexadecimal Sean Timmons Excel Discussion (Misc queries) 6 January 5th 07 10:45 PM
Problem opening csv files with hexadecimal values Eyal Shwartzman Excel Discussion (Misc queries) 4 January 19th 06 05:33 PM
Search multiple values to return single values JANA Excel Worksheet Functions 8 October 27th 05 04:26 PM
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in test test Excel Programming 3 September 9th 03 08:53 PM


All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"