วิธีแปลงตัวเลขสกุลเงินเป็นคำใน Excel อย่างรวดเร็ว?
สมมติว่าคุณมีช่วงตัวเลขสกุลเงินที่ต้องการแปลงเป็นคำใน Excel และคุณมีเคล็ดลับด่วนๆ ใดๆ ที่จะช่วยแก้ปัญหานี้ได้อย่างรวดเร็วหรือไม่ บทช่วยสอนนี้แนะนำวิธีง่ายๆ ในการแปลงตัวเลขสกุลเงินหลายตัวเป็นคำภาษาอังกฤษในครั้งเดียวใน Excel
สะกดตัวเลขสกุลเงินเป็นคำด้วย VBA แบบยาว
สะกดตัวเลขสกุลเงินเป็นคำต่างๆด้วยฟังก์ชัน Numbers to Words ที่มีประโยชน์
สะกดตัวเลขสกุลเงินเป็นคำด้วย VBA แบบยาว
ใน Excel คุณไม่สามารถแปลงตัวเลขเป็นคำภาษาอังกฤษได้อย่างรวดเร็วยกเว้น VBA
1 กด Alt + F11 คีย์เพื่อเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง
2 คลิก สิ่งที่ใส่เข้าไป > โมดูล และวางด้านล่าง VBA ลงในไฟล์ โมดูล หน้าต่าง
VBA: แปลงตัวเลขสกุลเงินเป็นคำภาษาอังกฤษ
Function SpellNumberToEnglish(ByVal pNumber)
'Updateby20131113
Dim Dollars, Cents
arr = Array("", "", " Thousand ", " Million ", " Billion ", " Trillion ")
pNumber = Trim(Str(pNumber))
xDecimal = InStr(pNumber, ".")
If xDecimal > 0 Then
Cents = GetTens(Left(Mid(pNumber, xDecimal + 1) & "00", 2))
pNumber = Trim(Left(pNumber, xDecimal - 1))
End If
xIndex = 1
Do While pNumber <> ""
xHundred = ""
xValue = Right(pNumber, 3)
If Val(xValue) <> 0 Then
xValue = Right("000" & xValue, 3)
If Mid(xValue, 1, 1) <> "0" Then
xHundred = GetDigit(Mid(xValue, 1, 1)) & " Hundred "
End If
If Mid(xValue, 2, 1) <> "0" Then
xHundred = xHundred & GetTens(Mid(xValue, 2))
Else
xHundred = xHundred & GetDigit(Mid(xValue, 3))
End If
End If
If xHundred <> "" Then
Dollars = xHundred & arr(xIndex) & Dollars
End If
If Len(pNumber) > 3 Then
pNumber = Left(pNumber, Len(pNumber) - 3)
Else
pNumber = ""
End If
xIndex = xIndex + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumberToEnglish = Dollars & Cents
End Function
Function GetTens(pTens)
Dim Result As String
Result = ""
If Val(Left(pTens, 1)) = 1 Then
Select Case Val(pTens)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else
Select Case Val(Left(pTens, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit(Right(pTens, 1))
End If
GetTens = Result
End Function
Function GetDigit(pDigit)
Select Case Val(pDigit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function
3. จากนั้นบันทึกรหัสนี้และปิดหน้าต่างเพื่อกลับไปที่แผ่นงานและเลือกเซลล์ว่างพิมพ์สูตรนี้ = SpellNumberToEnglish (A2) (A2 คือตัวเลขสกุลเงิน) แล้วกด เข้าสู่ จากนั้นลากที่จับเติมลงเพื่อใช้สูตรนี้กับเซลล์ที่คุณต้องการ ดูภาพหน้าจอ:



สะกดตัวเลขสกุลเงินเป็นคำต่างๆด้วยฟังก์ชัน Spell Out Numbers ที่มีประโยชน์
หากคุณจำเป็นต้องแปลงตัวเลขเป็นคำตามปกติวิธีการข้างต้นต้องไม่ใช่วิธีที่ดีและสะดวกสำหรับคุณ อย่างไรก็ตามคุณสามารถใช้ไฟล์ ตัวเลขเป็นคำ ฟังก์ชั่นแปลงตัวเลขสกุลเงินเป็นคำภาษาอังกฤษหรือคำภาษาจีนได้อย่างรวดเร็วหากคุณมี Kutools สำหรับ Excel.
1. เลือกหมายเลขสกุลเงินแล้วคลิก Kutools > คอนเทนต์ > ตัวเลขเป็นคำ. ดูภาพหน้าจอ:
2 ใน ตัวเลขเป็นคำสกุลเงิน โต้ตอบตรวจสอบ ภาษาอังกฤษ or ภาษาจีน ตัวเลือกตามที่คุณต้องการ ดูภาพหน้าจอ:
3 คลิก Ok or สมัครสมาชิก. จากนั้นตัวเลขสกุลเงินที่คุณเลือกจะถูกแปลงเป็นคำ
ตัวเลขสกุลเงินเป็นคำภาษาอังกฤษ
ตัวเลขสกุลเงินเป็นคำภาษาจีน
หมายเหตุ คุณสามารถคัดลอกและวางตัวเลขสกุลเงินไปยังเวิร์กชีตอื่นก่อนที่จะนำตัวเลขไปใช้กับคำได้
Kutools สำหรับ Excel - เพิ่มประสิทธิภาพ Excel ด้วยเครื่องมือที่จำเป็นกว่า 300 รายการ เพลิดเพลินกับฟีเจอร์ AI ฟรีถาวร! Get It Now
การสาธิต: แปลงตัวเลขสกุลเงินเป็นคำโดยใช้ Kutools สำหรับ Excel
สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน
เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...
แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก
- เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
- เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
- เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!