Car for Life

หมวดไฟฟ้าทั่วไป อิเล็กทรอนิกส์ คอมพิวเตอร์ => ห้องคอมพิวเตอร์ => ข้อความที่เริ่มโดย: Auto Car ที่ 08 พฤศจิกายน 2021, 15:40:50

หัวข้อ: แปลงเลขอาริบคเป็นเลยไทยด้วยคำสั่งมาโคร
เริ่มหัวข้อโดย: Auto Car ที่ 08 พฤศจิกายน 2021, 15:40:50
Sub arabictothai()
For i = 0 To 9
With Selection.Find
.Text = Chr(48 + i)
.Replacement.Text = Chr(240 + i)
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next
End Sub
Sub thaitoarabic()
For i = 0 To 9
With Selection.Find
.Text = Chr(240 + i)
.Replacement.Text = Chr(48 + i)
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next
End Sub

มาจากที่นี่... (https://www.kroonut.com/step-by-step-%E0%B9%81%E0%B8%9B%E0%B8%A5%E0%B8%87%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%80%E0%B8%A5%E0%B8%82%E0%B9%84%E0%B8%97%E0%B8%A2-%E0%B8%AD%E0%B8%B2%E0%B8%A3%E0%B8%9A%E0%B8%B4%E0%B8%84-%E0%B9%83/)