Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2018, 05:18 PM
BobBridges's Avatar
BobBridges BobBridges is offline Difficulties with replacing certain language-specific characters using VBA. Windows 7 64bit Difficulties with replacing certain language-specific characters using VBA. 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
Reply

Tags
characters, replacing, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulties with replacing certain language-specific characters using VBA. A Macro to break lines automatically after specific number of characters Annie Wordy Word VBA 1 11-03-2017 08:36 PM
Difficulties with replacing certain language-specific characters using VBA. Deleting Characters in a specific location in Word 2010 ppayaw Word VBA 8 12-13-2016 08:11 AM
Customize grammar settings for specific language? jpgauvin Word 0 12-05-2016 03:06 PM
Difficulties with replacing certain language-specific characters using VBA. How do I Remove A Specific Amount of Characters from Lines in a Document? tatihulot Word 5 01-22-2016 05:55 AM
Difficulties with replacing certain language-specific characters using VBA. Extract Line of Text w/ specific characters up to the paragraph character, send to Excel dmarie123 Word VBA 10 07-20-2015 12:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft