Skip to content

Instantly share code, notes, and snippets.

View touchiep's full-sized avatar

Pongsathorn Sraouthai touchiep

View GitHub Profile
@touchiep
touchiep / NumberConverterWord.bas
Last active February 18, 2024 11:06
[VBA][Word] Code สำหรับแปลงเลขอารบิกเป็นไทย หรือแปลงเลขไทยเป็นอารบิก สำหรับใช้กับ Microsoft Word รวมถึงการตั้งค่าฟอนต์ TH SarabunPSK และ TH Sarabun New เป็นฟอนต์พื้นฐาน
Function TH2W(strInput As String) As String
'Convert Thai numeral to Western numeral
Dim numberArray
numberArray = Array(ChrW(3664), "0", _
ChrW(3665), "1", _
ChrW(3666), "2", _
ChrW(3667), "3", _
ChrW(3668), "4", _
ChrW(3669), "5", _
ChrW(3670), "6", _