View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default What is this Strange Characet? Find/Replace

You could read David McRitchie's notes:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side. Paste the code
there.

Then hit alt-f11 to get back to excel.
then hit alt-f8 (or tools|macro|macros) and select the macro and click run.

Option Explicit
Sub cleanEmUp()

Dim myBadChars As Variant
Dim iCtr As Long

myBadChars = Array(Chr(11))

For iCtr = LBound(myBadChars) To UBound(myBadChars)
ActiveSheet.Cells.Replace What:=myBadChars(iCtr), Replacement:="|", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next iCtr

End Sub

I replaced it with the vertical bar (|) in the code above.



D wrote:

ok- pasted it into word and it just moved down a line like I did a hard
return or something. Tried all different fonts and nothing.

I have no idea how to go about doing the VB route- any more hints on doing
that? Man this is getting to be a pain...
Thanks!
D

"talkswithnumber" wrote in
message ...

There are a couple of ways you could try to figure this out. The square
character shows up when the character's number doesn't have a
corresponding symbol (like a letter) defined in the font. Maybe you
could try a couple of other fonts in your text editor to see if it
changes into something that you can then figure out. Another option is
to run your file through a little vb code that checks what the char
number is at the position that this character appears in your file:

'myString has the text, and the character is at position 10
debug.print asc(mid(myString,10,1))

or something like that....


--
talkswithnumber
------------------------------------------------------------------------
talkswithnumber's Profile:
http://www.excelforum.com/member.php...o&userid=16841
View this thread: http://www.excelforum.com/showthread...hreadid=320304


--

Dave Peterson