ukdane
03-19-2009, 11:37 AM
This seems odd to me, but is probably simple for the Gurus to solve.
I have a workbook, that someone has sent me.
In one of the sheets is some text, which has been added from another program.
During the conversion, the letters Æ,Ø,Å have been replaced by a BOX. I recorded a marco which changed each instance of these, in the attempt to automate the process. (using the replace function). When I recorded the marco, it worked fine. the Æ boxes were replaced with Æ, the Ø boxes replaced with Ø and the Å boxes replaced with Å.
BUT when I looked at the VBA and rerun the Macro, the boxes had been replaced with ? and when run, the replace funtion replaced every character with the last letter in the code (in this case Æ).
When I just tried to copy the boxes in here (including examples of the words containing them, this is what I saw:
リ for Ø
ナ for Å
and ニ for Æ
If I try to copy these back into VBA, they are returned as ? again.
What code do I need to write in order for the correct letters to be replaced? Would it involve ANSI?
Help appreciated, as always.
Cells.Replace What:="?", Replacement:="Ø", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="?", Replacement:="Å", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="?", Replacement:="Æ", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
I have a workbook, that someone has sent me.
In one of the sheets is some text, which has been added from another program.
During the conversion, the letters Æ,Ø,Å have been replaced by a BOX. I recorded a marco which changed each instance of these, in the attempt to automate the process. (using the replace function). When I recorded the marco, it worked fine. the Æ boxes were replaced with Æ, the Ø boxes replaced with Ø and the Å boxes replaced with Å.
BUT when I looked at the VBA and rerun the Macro, the boxes had been replaced with ? and when run, the replace funtion replaced every character with the last letter in the code (in this case Æ).
When I just tried to copy the boxes in here (including examples of the words containing them, this is what I saw:
リ for Ø
ナ for Å
and ニ for Æ
If I try to copy these back into VBA, they are returned as ? again.
What code do I need to write in order for the correct letters to be replaced? Would it involve ANSI?
Help appreciated, as always.
Cells.Replace What:="?", Replacement:="Ø", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="?", Replacement:="Å", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="?", Replacement:="Æ", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False