Home > Topics > excel > body text

Four steps to teach you how to convert RMB numerical amounts into Chinese capital letters in Excel

WBOY
Release: 2022-06-24 11:56:36
forward
7472 people have browsed it

This article brings you relevant knowledge about excel, which mainly summarizes the methods of converting RMB numerical amounts into Chinese capital letters. Let’s take a look at them together. I hope it will be helpful to everyone.

Four steps to teach you how to convert RMB numerical amounts into Chinese capital letters in Excel

Related learning recommendations: excel tutorial

To convert numerical amounts into Chinese uppercase letters, you need to go through the following steps:

1. Convert Arabic lowercase numbers to Chinese uppercase. This can be used in the examples in the previous chapters to convert numbers into Chinese uppercase codes, such as:

Function RmbDx(ByVal c) As String<br>Application.Volatile True<br>c = Val (c)<br>RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")<br>RmbDx = Replace(RmbDx, "-", "negative")<br>End Function

2. Add "yuan" after the integer amount. You can use the IF statement and FIX rounding function to determine whether an amount is an integer amount.

Function RmbDx(ByVal c) As String<br>Application.Volatile True<br>c = Val(c)<br>RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2] ")<br>RmbDx = Replace(RmbDx, "-", "negative")<br>If c = Fix(c) Then<br>RmbDx = RmbDx & "元正"<br>End If<br>End Function

3. Add "yuan" and "cent" information to the amount that only contains "corner" information and does not include "cent" information.

Function RmbDx (ByVal c) As String<br>Application.Volatile True<br>Dim p As Integer<br>c = Val(c)<br>RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")<br>RmbDx = Replace(RmbDx, "-", "negative")<br>If c = Fix(c) Then<br>RmbDx = RmbDx & "元正"<br>Else<br>RmbDx = Replace(RmbDx, ".", "元")<br>If c * 10 = Fix(c * 10) Then<br>RmbDx = RmbDx & "角"<br>End If<br>End If<br>End Function

4. Add "angle" and "minute" information to the data containing "angle" and "minute" information.

Function RmbDx(ByVal c) As String<br>Application.Volatile True<br>Dim p As Integer<br>c = Val(c)<br>RmbDx = Application.WorksheetFunction.Text (c, "[DBNum2]")<br>RmbDx = Replace(RmbDx, "-", "negative")<br>If c = Fix(c) Then<br>RmbDx = RmbDx & "元全"<br>Else<br>p = InStr(RmbDx, ".")<br>RmbDx = Replace(RmbDx, ".", "元")<br>If c * 10 = Fix(c * 10) Then<br> RmbDx = RmbDx & "corner"<br>Else<br>RmbDx = Left(RmbDx, p) & Mid(RmbDx, p 1, 1) & "corner" & Right(RmbDx, 1) & "分"<br> End If<br>End If<br>End Function

In this way, you can get the custom function RmbDx that converts the RMB amount into Chinese uppercase amount. The effect is as shown below.

Four steps to teach you how to convert RMB numerical amounts into Chinese capital letters in Excel

Related learning recommendations: excel tutorial

The above is the detailed content of Four steps to teach you how to convert RMB numerical amounts into Chinese capital letters in Excel. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template