- Sub qs()
- With Sheet6
- .[g3:o7] = Empty
- For r = 3 To 7
- x = "¥" & Application.WorksheetFunction.Round(.Range("f" & r).Value * 100, 0)
-
- For i = 1 To Len(x)
- .Cells(r, 16 - i).Value = Left(Right(x, i), 1)
- Next
- Next
- x2 = x2 + Application.WorksheetFunction.Round(.Range("f7").Value * 100, 0)
- a = [{18,16,14,12,10,8,6,4,2}]
- For y = 1 To Len(x2)
- c = c + 1
- .Cells(8, a(c)).Value = zdxa(Left(Right(x2, y), 1))
- Next
- For i = c + 1 To UBound(a)
- .Cells(8, a(i)).Value = ChrW(&H2717)
- Next
- End With
- End Sub
- Function zdxa(x) '升级转数字人民币大写
- Dim a
- a = [{0,"零";1,"壹";2,"贰";3,"叁";4,"肆";5,"伍";6,"陆";7,"柒";8,"捌";9,"玖"}]
- Set dic = CreateObject("scripting.dictionary")
- For i = 1 To UBound(a)
- dic(CStr(a(i, 1))) = a(i, 2)
- dic(a(i, 1)) = a(i, 2)
- Next
- If dic.exists(x) Then
- zdxa = dic(x)
- Else
- zdxa = x
- End If
- Set dic = Nothing
- End Function
复制代码 |