Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-23-2018, 11:18 PM
Franci Franci is offline Difficulties with replacing certain language-specific characters using VBA. Windows 7 32bit Difficulties with replacing certain language-specific characters using VBA. Office 2010 32bit
Novice
Difficulties with replacing certain language-specific characters using VBA.
 
Join Date: May 2016
Posts: 12
Franci is on a distinguished road
Default Difficulties with replacing certain language-specific characters using VBA.

In excel, I need to process data that is prepared and exported from another application in the .xls file format.


Because certain language-specific characters in this .xls file are not displayed properly (eg "è" instead of "č"), I wanted to replace them with the help of a macro. So I recorded a macro, which should replace, for example, all "è" characters with the "č" character. There was no problem while recording the macro and all the characters were replaced correctly. But running the same macro on another .xls file caused a problem because instead of all "è" characters, all "e" characters were replaced with "č" character.
This is part of a code I recorded:
Code:
Cells.Replace What:="e", Replacement:="č", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
The recorded VBA code shows that the character to be replaced is not correctly displayed and is actually "e" and not "è". Therefore, I tried to paste the character "è" into the code instead. Unfortunately, this was not successful because after pasting, a question mark ("?") appeared.

Code:
Cells.Replace What:="?", Replacement:="č", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
How can I make a macro that will replace characters correctly?
Reply With Quote
 

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 06:05 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