View Single Post
 
Old 05-24-2018, 05:18 PM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Franci, just to be clear, have you tried running the program since you pasted "è" into the program and saw it recorded as "?"? I ask because it's just possible the VBA Editor doesn't know how to display such characters on the screen but nevertheless stores them correctly. You could try running it and see what happens.


But that's just a thought; worth trying but I don't really believe it. If I were attempting this, the next thing I'd try is to use hex constants in your code, like this:
Code:
Cells.Replace What:=&H00E8, Replacement:=&H010D, LookAt:=xlPart, SearchOrder:=xlByRows _
  , MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
If that doesn't work, you might have to set two string variables to the What and Replacement values and put them in the code instead:
Code:
Cells.Replace What:=sWhat, Replacement:=sRepl, LookAt:=xlPart, SearchOrder:=xlByRows _
  , MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
One problem is that the "č" character requires an extra byte (is that what they call "Unicode"?); I'm not sure how you represent that in VBA. You might have to examine the value where it appears in a worksheet and see what hex code is being used under the covers.
Reply With Quote