把数字转成英文字_VB.net_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

把数字转成英文字

作者:黑客防线网安VB教程基地 来源:黑客防线网安VB教程基地 浏览次数:0

本篇关键词:文字数字CaseMyStr
黑客防线网安网讯:●建立D2T巨集,并把快速键设为Shift Ctrl T。      ●写入程式码:    SubD2T()  DimMyStrAsString  MyStr=ActiveCell.Text    IfIsNumeric(MyStr)=TrueThen  ActiveC...
●建立D2T巨集并把快速键设为Shift Ctrl T
  
  
  ●写入程式码:
  
  SubD2T()
  DimMyStrAsString
  MyStr=ActiveCell.Text
  
  IfIsNumeric(MyStr)=TrueThen
  ActiveCell.Value=""
  
  SelectCaseLen(MyStr)
  Case1
  OneDG(MyStr)
  Case2
  TwoDG(MyStr)
  Case3
  ThreeDG(MyStr)
  Case4
  OneDG(Left(MyStr,1))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case5
  TwoDG(Left(MyStr,2))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case6
  ThreeDG(Left(MyStr,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case7
  OneDG(Left(MyStr,1))
  ActiveCell.Value=ActiveCell.Value "Millon"
  ThreeDG(Mid(MyStr,2,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case8
  TwoDG(Left(MyStr,2))
  ActiveCell.Value=ActiveCell.Value "Millon"
  ThreeDG(Mid(MyStr,3,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case9
  ThreeDG(Left(MyStr,3))
  ActiveCell.Value=ActiveCell.Value "Millon"
  ThreeDG(Mid(MyStr,4,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case10
  OneDG(Left(MyStr,1))
  ActiveCell.Value=ActiveCell.Value "Billon"
  ThreeDG(Mid(MyStr,2,3))
  ActiveCell.Value=ActiveCell.Value "Millon"
  ThreeDG(Mid(MyStr,5,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  Case11
  TwoDG(Left(MyStr,2))
  ActiveCell.Value=ActiveCell.Value "Billon"
  ThreeDG(Mid(MyStr,3,3))
  ActiveCell.Value=ActiveCell.Value "Millon"
  ThreeDG(Mid(MyStr,6,3))
  ActiveCell.Value=ActiveCell.Value "Thousand"
  ThreeDG(Right(MyStr,3))
  CaseElse
  EndSelect
  EndIf
  EndSub
  
  SubOneDG(MyStrAsString)
  SelectCaseMyStr
  Case"0"
  IfActiveCell.Value=""ThenActiveCell.Value=ActiveCell.Value "Zero"
  Case"1"
  ActiveCell.Value=ActiveCell.Value "One"
  Case"2"
  ActiveCell.Value=ActiveCell.Value "Two"
  Case"3"
  ActiveCell.Value=ActiveCell.Value "Three"
  Case"4"
  ActiveCell.Value=ActiveCell.Value "Four"
  Case"5"
  ActiveCell.Value=ActiveCell.Value "Five"
  Case"6"
  ActiveCell.Value=ActiveCell.Value "Six"
  Case"7"
  ActiveCell.Value=ActiveCell.Value "Seven"
  Case"8"
  ActiveCell.Value=ActiveCell.Value "Eight"
  Case"9"
  ActiveCell.Value=ActiveCell.Value "Nine"
  EndSelect
  EndSub
  
  SubTwoDG(MyStrAsString)
  SelectCaseMyStr
  Case"10"
  ActiveCell.Value=ActiveCell.Value "Ten"
  Case"11"
  ActiveCell.Value=ActiveCell.Value "eleven"
  Case"12"
  ActiveCell.Value=ActiveCell.Value "Twelve"
  Case"13"
  ActiveCell.Value=ActiveCell.Value "Thirteen"
  Case"14"
  ActiveCell.Value=ActiveCell.Value "Fourteen"
  Case"15"
  ActiveCell.Value=ActiveCell.Value "Fifteen"
  Case"16"
  ActiveCell.Value=ActiveCell.Value "Sixteen"
  Case"17"
  ActiveCell.Value=ActiveCell.Value "Seventeen"
  Case"18"
  ActiveCell.Value=ActiveCell.Value "Eighteen"
  Case"19"
  ActiveCell.Value=ActiveCell.Value "Nineteen"
  CaseElse
  SelectCaseLeft(MyStr,1)
  Case"2"
  ActiveCell.Value=ActiveCell.Value "Twenty"
  Case"3"
  ActiveCell.Value=ActiveCell.Value "Thirty"
  Case"4"
  ActiveCell.Value=ActiveCell.Value "Forty"
  Case"5"
  ActiveCell.Value=ActiveCell.Value "Fifty"
  Case"6"
  ActiveCell.Value=ActiveCell.Value "Sixty"
  Case"7"
  ActiveCell.Value=ActiveCell.Value "Seventy"
  Case"8"
  ActiveCell.Value=ActiveCell.Value "Eighty"
  Case"9"
  ActiveCell.Value=ActiveCell.Value "Ninety"
  EndSelect
  OneDG(Right(MyStr,1))
  EndSelect
  
  EndSub
  
  SubThreeDG(MyStrAsString)
  SelectCaseLeft(MyStr,1)
  Case"1"
  ActiveCell.Value=ActiveCell.Value "OneHandred"
  Case"2"
  ActiveCell.Value=ActiveCell.Value "TwoHandred"
  Case"3"
  ActiveCell.Value=ActiveCell.Value "ThreeHandred"
  Case"4"
  ActiveCell.Value=ActiveCell.Value "FourHandred"
  Case"5"
  ActiveCell.Value=ActiveCell.Value "FiveHandred"
  Case"6"
  ActiveCell.Value=ActiveCell.Value "SixHandred"
  Case"7"
  ActiveCell.Value=ActiveCell.Value "SevenHandred"
  Case"8"
  ActiveCell.Value=ActiveCell.Value "EightHandred"
  Case"9"
  ActiveCell.Value=ActiveCell.Value "NightHandred"
  EndSelect
  TwoDGRight(MyStr,2)
  EndSub
  ●上面的程式码可以处理到11位数●随意输入一个未超过11位数的数字然后把输入游标移到该Cell里。
  
  ●一同按下Shift Ctrl T。->

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-14500-1.html
网站维护教程更新时间:2012-04-03 01:07:53  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer