Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Deal with text characters that are greater than chr(127)

I am dealing with a spreadsheet that is downloaded from another
application. The parent application allows html text and includes some
bullits. When this text is downlaoded to an excel spreadhseet the
bullits are converted to the followng text string:

€’

The ’ is chr(128) and the € is chr(162) (I may have these reversed?)
but I have not been able to determine the code for the .

But indepedent of not knowing the code for the one character I'm
having trouble dealing with these characters. Using a manual search
for just one character nothing is found.

I'd like to replace this string of characters (€’) with a "-" and
maybe a CR/LF at the start so that the resulting text looks similar to
the html.

How do I deal with these unusual characters?

Thanks for the suggestions!


John Keith

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Deal with text characters that are greater than chr(127)

not sure what characters you need, but if all you need are alphanumeric, 122
should be the highest number you need. if it's 123, then delete it.
or you can test for the following values:

48 - 57 are 0-9
65 - 90 are A-Z
97-122 are a-z

or look at the character map in windows to find your character.

--


Gary Keramidas
Excel 2003


"John Keith" wrote in message
...
I am dealing with a spreadsheet that is downloaded from another
application. The parent application allows html text and includes some
bullits. When this text is downlaoded to an excel spreadhseet the
bullits are converted to the followng text string:

?’

The ’ is chr(128) and the ? is chr(162) (I may have these reversed?)
but I have not been able to determine the code for the .

But indepedent of not knowing the code for the one character I'm
having trouble dealing with these characters. Using a manual search
for just one character nothing is found.

I'd like to replace this string of characters (?’) with a "-" and
maybe a CR/LF at the start so that the resulting text looks similar to
the html.

How do I deal with these unusual characters?

Thanks for the suggestions!


John Keith


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deal with text characters that are greater than chr(127)


I usually crate a sime macro for debugging these
probelms


InputSr = "abcdefghij"
rowcount = 1
for i = 1 to len(InputStr)
.cells(RowCount,i) = asc(mid(InputStr,i,1))
next i

to replaced the character one you find the results use this

Replace_What = chr(128) & chr(162) & chr(x) 'x is last character
Replace_By = vbLf '"-"

b = InStr(a, Replace_What)
While b 0
a = Mid(a, 1, b - 1) & Replace_By & Mid(a, b + Len(Replace_What))
b = InStr(a, Replace_What)
Wend

Cells(1, 1).Formula = a


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=166507

Microsoft Office Help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Deal with text characters that are greater than chr(127)

On Sun, 3 Jan 2010 00:49:43 -0500, "Gary Keramidas"
<GKeramidasAtMSN.com wrote:

or look at the character map in windows to find your character.


Gary,

Thank you for the suggestion to look at the character map. I now have
some basic info on each character (I had to select several diffeerent
fonts before I found each character):

keystroke to enter:

ALT + 0128 €
ALT + 0162 ’
ALT + 0226

This insight along with the other suggestions may solve the issue.

This exercise will be another learning experience! I've not had to
deal with what I would call non-standard ASCII before.


John Keith



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Deal with text characters that are greater than chr(127)

On Sun, 3 Jan 2010 11:44:32 +0000, joel
wrote:


I usually crate a sime macro for debugging these
probelms



Joel,

I had started with some simple cut and paste into the Find and Replace
in Excel but was not successful with that. I also used a macro to
simply create all ASCII characters and even that didn't get me to any
useful results.

Later today I'll play with your suggestion.

Thanks


John Keith

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Deal with text characters that are greater than chr(127)

Mishell,

Thank oyu for your suggestion. It appears to be somewhat similar to
the method Joel suggested and I will give it a try later today as
well.



John Keith

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Deal with text characters that are greater than chr(127)

Thanks for the pointers, the problem has been solved!

The simple code line below replaces all occurences of the characters I
wanted to find:

Cells.Replace What:="€’", Replacement:=Chr(10) & "-"

The characters are entered inside the quotes by using the key
sequences noted below:


keystroke to enter:

ALT + 0226
ALT + 0128 €
ALT + 0162 ’



John Keith

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Deal with text characters that are greater than chr(127)

glad you got it worked out.

--


Gary Keramidas
Excel 2003


"John Keith" wrote in message
...
Thanks for the pointers, the problem has been solved!

The simple code line below replaces all occurences of the characters I
wanted to find:

Cells.Replace What:="?’", Replacement:=Chr(10) & "-"

The characters are entered inside the quotes by using the key
sequences noted below:


keystroke to enter:

ALT + 0226
ALT + 0128 ?
ALT + 0162 ’



John Keith


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
Has anyone made a Deal or No Deal Gameboard? [email protected] Excel Programming 2 April 17th 08 12:12 AM
Has anyone made a Deal or No Deal Gamebord [email protected] Excel Discussion (Misc queries) 2 April 17th 08 12:12 AM
Greater than less than arguement returning value when text inputte Jbaisinger2000 Excel Discussion (Misc queries) 2 October 15th 07 06:57 PM
how do i display cell contents greater than 255 characters in a t. Richard Lamey Excel Discussion (Misc queries) 1 February 13th 06 03:45 AM
Cell Content Greater than 24 Characters. dlnorris Excel Worksheet Functions 3 October 14th 05 09:18 PM


All times are GMT +1. The time now is 07:49 PM.

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

About Us

"It's about Microsoft Excel"