ไปยังเนื้อหาหลัก

วิธีแทนที่อักขระเน้นเสียงด้วยอักขระปกติใน Excel

คุณได้รับรายงานที่มีอักขระเน้นเสียงใน Microsoft Excel หรือไม่? มันดูน่าเบื่อที่จะอ่านทั้งเวิร์กบุ๊กและแทนที่อักขระที่เน้นเสียงเป็นอักขระปกติด้วยตนเองเช่น "û"เป็น" u "และบทความนี้จะแนะนำสิ่งที่ยุ่งยากในการแทนที่อักขระที่เน้นเสียงด้วยอักขระปกติใน Excel อย่างรวดเร็ว


แทนที่อักขระเน้นเสียงด้วยอักขระปกติด้วย VBA

สำหรับผู้ใช้ที่มีประสบการณ์กับ Microsoft Excel การใช้แมโคร VBA เป็นวิธีง่ายๆในการจัดการกับงานที่ซับซ้อนนี้

1. ค้างไว้ อื่น ๆ + F11 ใน Excel และจะเปิดไฟล์ หน้าต่าง Microsoft Visual Basic for Applications.

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางมาโครต่อไปนี้ในไฟล์ หน้าต่างโมดูล.

Function StripAccent(thestring As String)
Dim A As String * 1
Dim B As String * 1
Dim i As Integer
Const AccChars= "ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿ"
Const RegChars= "SZszYAAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyy"
For i = 1 To Len(AccChars)
A = Mid(AccChars, i, 1)
B = Mid(RegChars, i, 1)
thestring = Replace(thestring, A, B)
Next
StripAccent = thestring
End Function

3. จากนั้นไปที่เซลล์ว่างแล้ววางสูตรในเซลล์: = CheckStringCHAR (InString), ตัวอย่างเช่น = CheckStringCHAR ("ù"),หรือ = CheckStringCHAR (A2).

หมายเหตุ:
(1) Microsoft Visual Basic ของคุณอาจไม่รู้จักอักขระที่เน้นเสียงเลยหากไม่รองรับ Unicode ตัวอย่างเช่นเมื่อคุณวาง "š" ใน Visual Basic คุณอาจได้รับ "?" ถ้าเป็นเช่นนั้นมาโครนี้จะไม่สามารถใช้งานได้
(2) ไม่แทนที่อักขระเน้นเสียงในสตริงของเซลล์ที่เลือกโดยตรง


แทนที่อักขระเน้นเสียงด้วยอักขระปกติด้วย Kutools for Excel

ต้องใช้ทักษะและความรู้มากเกินไปในการใช้มาโคร VBA และวิธีการต่อไปนี้จะช่วยให้คุณทำงานได้ง่ายขึ้นด้วยการคลิกเพียงบางครั้ง Kutools สำหรับ Excel ของแทนที่เครื่องมืออักขระเน้นเสียงช่วยให้คุณสามารถแทนที่อักขระเน้นเสียงทุกชนิดด้วยอักขระปกติได้อย่างง่ายดายในคราวเดียว

Kutools สำหรับ Excel - เพิ่มประสิทธิภาพ Excel ด้วยเครื่องมือที่จำเป็นมากกว่า 300 รายการ เพลิดเพลินกับฟีเจอร์ทดลองใช้ฟรี 30 วันโดยไม่ต้องใช้บัตรเครดิต! Get It Now

1. เลือกช่วงที่คุณจะแทนที่อักขระที่เน้นเสียงทั้งหมด

2. คลิก Kutools > ข้อความ > แทนที่อักขระที่เน้นเสียง…, ดูภาพหน้าจอ:

3. In แทนที่อักขระที่เน้นเสียง ใหคลิกปุ the ม เลือกทั้งหมด เพื่อเลือกกฎการแทนที่ทั้งหมดและคลิกปุ่มตกลงเพื่อแทนที่อักขระที่เน้นเสียงทั้งหมด ดูภาพหน้าจอ:

หมายเหตุ / รายละเอียดเพิ่มเติม:
(1) หากไม่มีอักขระเน้นเสียงเฉพาะที่คุณต้องการคุณสามารถคลิกที่ไฟล์ เพิ่มกฎ เพื่อเพิ่มกฎของคุณเองลงในกล่องรายการด้านบนกล่องโต้ตอบแทนที่อักขระที่เน้นเสียง
(2) คุณสามารถกำหนดกฎการแทนที่ใหม่ได้ในกล่องโต้ตอบแทนที่อักขระที่เน้นเสียง

ตอนนี้คุณจะมีอักขระเน้นเสียงทั้งหมดในสตริงของช่วงที่เลือกแปลงเป็นอักขระปกติทันที ดูภาพหน้าจอ:

พื้นที่ แทนที่อักขระที่เน้นเสียง คุณลักษณะของ Kutools for Excel สามารถแทนที่อักขระเน้นเสียงทุกชนิดด้วยอักขระปกติในสมุดงานทั้งหมดได้อย่างง่ายดาย ทดลองใช้ฟรี!

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How can I replace multiple characters with a single one? For example é with e?
This comment was minimized by the moderator on the site
Dobrý deň, starší súbor xlsm mi vo win11 debuguje na tom, že nevie nájsť meno hárka "Prehľad", má problém s diakritikou.
Nie je problém zmeniť pomenovanie hárka na nové bez diakritiky resp. vyhľadať objekt inak, oveľa väčší problém je však zároveň ten,
že z tohto súboru v exceli pomocou VBA odosielam emaily a ak chcem pomocou VBA napísať telo emailu, tak sa mi v outlooku
menia písmená s diakritikou (č, ď, ť ...) na rôzne zástupné znaky. Email vyzerá nedôstojne a nechcem ho písať ani bez diakritiky,
pretože sme predsa na Slovensku a komunikujeme ešte v materinskej reči...
Môžete mi prosím napísať, či sa tento problém dá odstrániť konkrétnym nastavením windows alebo officu?
V predošlom počítači to fungovalo bez problémov.
Ďakujem pekne.
This comment was minimized by the moderator on the site
I tried that VBA script on my worksheet which had several names with accent characters. This did a nice job of cleaning them up. Thanks.
This comment was minimized by the moderator on the site
I have added the code and it work perfectly however I need to add more accent to the code as I´m missing polish accents. How can I edit the code and add those accents? I try to do it in a notepad and then paste again the code but it change the letter back to normal characters. I'm not an expert so I really need your help please!
This comment was minimized by the moderator on the site
Const AccChars = "ŠŽšžYAÁÂAÄAÇEÉEËIÍÎI?NOóÔOÖUÚUÜÝaáâaäaçeéeëiíîi?noóôoöuúuüýyĄĘĆŁŃóŚŻŹąęćłńóśżź"
Const RegChars = "SZszYAAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyyAECLNOSZZaeclnoszz"
This comment was minimized by the moderator on the site
The VBA function StripAccent() worked like a charm, thank you very much for it. But I would like to ask what exactly does this "* 1" at at the end of "Dim A As String * 1" initialization string, I've never seen that before and I wasn't able to find an answer to that myself so far.
This comment was minimized by the moderator on the site
when you remove special character it also remove the space between the text ??
This comment was minimized by the moderator on the site
is it possible to replace multiple characters with another character? There is no way to say I want to replace é by é

How can I do mass replacements like this in Kutools for Excel? I like the multireplace functionality but it would be a lot more useful if replacement of entire words would be possible. Anyboy any idea how I can do this?
This comment was minimized by the moderator on the site
If you are looking to replace a specific accent character (ex. é), you can do a Find and Replace All (search for "é" and replace with "e"). This solved my problem.
This comment was minimized by the moderator on the site
No shit Sherlock
This comment was minimized by the moderator on the site
Hello, Excellent Macro. Thanks for posting this. However I am wondering if I want to replace all of the characters in the excel file, how can I do that at once? Thanks Vivek
This comment was minimized by the moderator on the site
On the "Replace accented characters with regular characters with VBA" part, step 3, you must replace CheckStringCHAR for STRIPACCENT, which is the name of the function in the provided code!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations