zoukankan      html  css  js  c++  java
  • 调用EXCEL 实现阿拉伯数字转中文

    方法一:

    Private Sub Command1_Click()
    Dim xlapp As Object, n As Currency, temp As String
    Set xlapp = CreateObject("Excel.Application")
    Randomize
    n = Int(Rnd * 10 ^ 15)
    temp = n
    temp = temp & vbCrLf & xlapp.Evaluate("NUMBERSTRING(" & n & ", 1)")
    temp = temp & vbCrLf & xlapp.Evaluate("NUMBERSTRING(" & n & ", 2)")
    temp = temp & vbCrLf & xlapp.Evaluate("NUMBERSTRING(" & n & ", 3)")
    Set xlapp = Nothing
    MsgBox temp
    End Sub
     

    方法二:

    Private Sub Command1_Click()
    Dim xlapp As Object, n As Currency, temp As String
    Set xlapp = CreateObject("Excel.Application")
    Randomize
    n = Int(Rnd * 10 ^ 12)
    temp = n
    temp = temp & vbCrLf & xlapp.Evaluate("text(" & n & ",""[dbnum1]"")")
    temp = temp & vbCrLf & xlapp.Evaluate("text(" & n & ",""[dbnum2]"")")
    temp = temp & vbCrLf & xlapp.Evaluate("text(" & n & ",""0[dbnum1]"")")
    Set xlapp = Nothing
    MsgBox temp
    End Sub

  • 相关阅读:
    String系列
    java初始化构造函数调用顺序
    转发和重定向的区别
    HttpServletResponse对象
    JSP九大隐式对象
    关于异常
    MySQL下载、安装及启动
    MySQL的启动
    MySQL下载及安装
    U盘安装Win7操作系统
  • 原文地址:https://www.cnblogs.com/fengju/p/6336297.html
Copyright © 2011-2022 走看看