Բաց թողնել հիմնական բովանդակությունը

Ինչպե՞ս Excel- ում գրել կամ վերափոխել թվերը անգլերեն բառերի:

Ենթադրելով, որ դուք ունեք շատ գների քանակի համարներ, և այժմ դուք պետք է դրանք վերափոխեք կամ գրեք տեքստի տողերի: Օրինակ ՝ դարձի բերել $123.55 անգլերեն բառերին հարյուր քսաներեք դոլար և հիսունհինգ ցենտ, Excel- ում այս խնդիրը լուծելու համար արդյունավետ միջոց չկա, բայց օգտագործելով երկար և բարդ VBA կոդը: Այս հոդվածում ես ձեզ կներկայացնեմ դրա հետ կապված որոշ մեթոդներ:

VBA կոդով թվերը գրեք կամ վերափոխեք անգլերեն բառերի

Excel- ի համար Kutools- ով ուղղիր կամ փոխիր թվերը անգլերեն բառերի


VBA կոդով թվերը գրեք կամ վերափոխեք անգլերեն բառերի

Հետևյալ երկար VBA կոդը կարող է օգնել թվերը գրել տեքստային տողերի վրա: Կատարեք հետևյալ կերպ.

1, Պահեք պահեք ALT + F11 ստեղները, և այն բացում է Microsoft Visual Basic հավելվածների համար պատուհան.

2: Սեղմեք Տեղադրել > Մոդուլներ, և տեղադրեք հետևյալ մակրոը ՝ Մոդուլի պատուհանը:

VBA. Excel- ում անգլերեն բառերի ուղղիր արտարժույթի համարները

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, Դրանից հետո պահեք կոդը և վերադարձեք աշխատաթերթ ՝ հարակից Բջջային B2- ում, մուտքագրեք բանաձևը = SpellNumberToEnglish (A1), տես նկարի նկարը.

4, Դրանից հետո սեղմեք Մտնել ստեղնը և ընտրեք Cell B2- ը, այնուհետև լրացնելու բռնիչը քաշեք դեպի այն սահմանը, որը պարունակում է այս բանաձևը, որքան ձեզ հարկավոր է: Եվ արժույթի բոլոր համարները գրվել են անգլերեն բառերով: Տեսեք,

ՆշումՔանի որ դրանք բանաձևեր են, երբ անհրաժեշտ է դրանք պատճենել և տեղադրել, խնդրում ենք կպցնել որպես արժեքներ:


Excel- ի համար Kutools- ով ուղղիր կամ փոխիր թվերը անգլերեն բառերի

Գուցե վերը նշված երկար ծածկագիրը կարող է ձեզ խելագարության պատճառ դարձնել, խնդրում եմ մի անհանգստացեք, այստեղ ես կարող եմ ձեզ տալ այն լուծելու հեշտ և արագ միջոց: Հետ Excel- ի համար նախատեսված գործիքներ'S Բառեր համարներ գործառույթը, դուք կարող եք արագ և հարմարավետ դարձնել թվերը տեքստի տողեր:

Excel- ի համար նախատեսված գործիքներ- Ներառում է ավելի քան 300 հարմար գործիքներ Excel- ի համար: 30 օրյա անվճար փորձնական ամբողջական հնարավորություն, վարկային քարտ չի պահանջվում: Get It Now

1, Ընտրեք ընդգրկույթի համարները, որոնք ցանկանում եք գրել, և կտտացրեք Կուտոլս > Պարունակություն > Բառեր համարներ.
doc kutools թիվը բառերի 1-ին

2, Բացվող երկխոսության դաշտում ընտրեք Անգլերեն - ից լեզուներ, Եվ արդյունքները կարող եք նախադիտել աջից Preview Վահանակ Տեսեք,
doc kutools թիվը բառերի 2-ին

3. Այնուհետեւ կտտացրեք Ok or Դիմել, Եվ գնի գումարի բոլոր համարները վերածվել են տեքստի տողերի ՝ սկզբնական տիրույթում:
doc kutools թիվը բառերի 3-ին

ՆշումԵթե ​​պարզապես ուզում եք թվերը փոխարկել անգլերեն բառերի (ոչ թե արժույթի), խնդրում ենք ստուգել Չի փոխարկվել արտարժույթի վանդակը.
doc kutools թիվը բառերի 3-ին doc kutools թիվը բառերի 3-ին

Այս ֆանտաստիկ առանձնահատկությունը Բառեր համարներ կարող է հեշտությամբ թարգմանել արժույթի համարները անգլերենի կամ չինարենի արժույթի տեքստ, օրինակ `32.01-ը թարգմանել« Երեսուներկու դոլար և մեկ ցենտ »կամ« 叁拾 贰元 零 壹 分 »: Անցկացրեք անվճար փորձություն:

Demo: Ուղղեք արտարժույթի համարները անգլերեն բառերը

Գրասենյակի արտադրողականության լավագույն գործիքները

🤖 Kutools AI օգնականՀեղափոխություն կատարել տվյալների վերլուծության հիման վրա՝ Խելացի կատարում   |  Ստեղծեք ծածկագիր  |  Ստեղծեք հատուկ բանաձևեր  |  Վերլուծել տվյալները և ստեղծել գծապատկերներ  |  Invoke Kutools-ի գործառույթները...
Հանրաճանաչ հատկություններ: Գտեք, ընդգծեք կամ նույնականացրեք կրկնօրինակները   |  Deleteնջել դատարկ շարքերը   |  Միավորել սյունակները կամ բջիջները՝ առանց տվյալների կորստի   |   Կլոր առանց բանաձևի ...
Super Փնտրել: Բազմաթիվ չափանիշների VLookup    Բազմակի արժեք VLookup  |   VLookup բազմաթիվ թերթերում   |   Fuzzy Փնտրել ....
Ընդլայնված բացվող ցուցակ: Արագ ստեղծեք բացվող ցուցակը   |  Կախված բացվող ցուցակ   |  Բազմակի ընտրություն Drop Down ցուցակ ....
Սյունակի կառավարիչ: Ավելացրեք որոշակի քանակությամբ սյունակներ  |  Տեղափոխել սյունակները  |  Փոխարկել թաքնված սյունակների տեսանելիության կարգավիճակը  |  Համեմատեք միջակայքերը և սյունակները ...
Առանձնահատկություններ: Ցանցի կենտրոնացում   |  Դիզայնի տեսք   |   Մեծ Formula Bar    Աշխատանքային գրքույկի և թերթիկների կառավարիչ   |  Ռեսուրսների գրադարան (Ավտոմատ տեքստ)   |  Ամսաթիվ ընտրող   |  Միավորել աշխատանքային թերթերը   |  Գաղտնագրել/գաղտնազերծել բջիջները    Ուղարկեք նամակներ ըստ ցանկի   |  Սուպեր զտիչ   |   Հատուկ զտիչ (զտել թավ/շեղ/շեղված...) ...
Լավագույն 15 գործիքների հավաքածու12 Տեքստ Գործիքներ (Ավելացրեք տեքստ, Հեռացնել նիշերը, ...)   |   50+ Աղյուսակ Տեսակներ (Գանտի աղյուսակը, ...)   |   40+ Գործնական Բանաձեւեր (Հաշվարկել տարիքը ՝ ելնելով ծննդյան տարեդարձից, ...)   |   19 միացում Գործիքներ (Տեղադրեք QR կոդ, Տեղադրեք նկար ուղուց, ...)   |   12 Փոխարկում Գործիքներ (Բառեր համարներ, Արտարժույթի փոխակերպումը, ...)   |   7 Միաձուլում և պառակտում Գործիքներ (Ընդլայնված կոմբինատ տողեր, Պառակտված բջիջներ, ...)   |   ... եւ ավելին

Լրացրեք ձեր Excel-ի հմտությունները Kutools-ի հետ Excel-ի համար և փորձեք արդյունավետությունը, ինչպես երբեք: Kutools-ը Excel-ի համար առաջարկում է ավելի քան 300 առաջադեմ առանձնահատկություններ՝ արտադրողականությունը բարձրացնելու և ժամանակ խնայելու համար:  Սեղմեք այստեղ՝ Ձեզ ամենաշատ անհրաժեշտ հատկանիշը ստանալու համար...

Նկարագրություն


Office Tab- ը Tabbed ինտերֆեյսը բերում է Office, և ձեր աշխատանքը շատ ավելի դյուրին դարձրեք

  • Միացնել ներդիրներով խմբագրումը և ընթերցումը Word, Excel, PowerPoint- ով, Հրատարակիչ, Access, Visio և Project:
  • Բացեք և ստեղծեք բազմաթիվ փաստաթղթեր նույն պատուհանի նոր ներդիրներում, այլ ոչ թե նոր պատուհաններում:
  • Բարձրացնում է ձեր արտադրողականությունը 50%-ով և նվազեցնում մկնիկի հարյուրավոր սեղմումները ձեզ համար ամեն օր:
Comments (112)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi! How would I go about adding hyphens ( - ) between compound numbers, so instead of it spelling 55 as Fifty Five it would spell Fifty-Five. Simply adding hyphens to all "tens" obviously doesn't work since that would mean tat 20,000,000 would be spelled as "Twenty- Million". Thanks to whoever can solve this!
This comment was minimized by the moderator on the site
Hi! How would I go about adding hyphens ( - ) between compound numbers, so instead of it spelling 55 as Fifty Five it would spell Fifty-Five. Simply adding hyphens to all "tens" obviously doesn't work since that would mean tat 20,000,000 would be spelled as "Twenty- Million". Thanks to whoever can solve this!
This comment was minimized by the moderator on the site
not suitable for indian currency allways show in doller
This comment was minimized by the moderator on the site
Hi prem,
At present, this Numbers to Words feature enables to convert numbers to Chinese Yuan and US Dollars.
This comment was minimized by the moderator on the site
How can i get actuall figure without "no cents/ no dollars", if it's not needed. Please Email me in shown Mail ID.
This comment was minimized by the moderator on the site
HAVE U GOT ANY SOLUTION FOR THIS
This comment was minimized by the moderator on the site
just delete the no cents on line 46 and no dollars on line 38, leave it "" only
This comment was minimized by the moderator on the site
I was unable to do it, I don't know what happened to it, first of all it was OK, but only for one time then it shows this sign #NAME? can any one help me in this regards.
This comment was minimized by the moderator on the site
Save it as Excel Macro Enable Workbook. and each time you will open the file, you'll see a Security Warning prompt (usually on top of Formula Bar) you have to click the Option button and tick the "Enable this content". This would solve your problem. Hope it would help
This comment was minimized by the moderator on the site
Please try one more time
This comment was minimized by the moderator on the site
everytime i close the file.. the complete program is lost.. how can i save this for all my excel files
This comment was minimized by the moderator on the site
thanks for the excellent job, I tried it , great , its working , greetings from Sri Lanka
This comment was minimized by the moderator on the site
We thank you for this guideline it is most helpful, but how can i change the currency from Dollars to Rwandan Francs?

Thanks
This comment was minimized by the moderator on the site
search the below texts in the vba code and replace eg : search 1 >> Search for "Dollars" Replace with "Rwandan Francs"
search 2 >> Search for "Dollar" Replace with "Rwandan Franc"
This comment was minimized by the moderator on the site
I have followed the guidelines and managed to do it perfectly well for the first time. I have been designing templates and it has worked for me. Thank you so much.
This comment was minimized by the moderator on the site
i wan to change this eg:( one hundred thousand rupees only ), pls explain me how to get that word "only"
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations