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

  • 相关阅读:
    typeof返回的结果必定是字符串
    coe文件格式
    求余算法的FPGA实现
    dBm
    信噪比
    增益
    总谐波失真THD
    基波与谐波
    Tco时候在干嘛?
    AXI4-Slave自定义IP设计
  • 原文地址:https://www.cnblogs.com/fengju/p/6336297.html
Copyright © 2011-2022 走看看