EXCEL-单元格输入提示,自动补全,简码输入,首字母拼音及汉子模糊匹配

很多实际工作中输入信息时 其输入源数据表是已经固定的
为了提高输入速度和准确度 就需要和输入法一样在输入时给出自动提示和模糊匹配
具体实现效果如下图
基本实现为用文本框和列表框 查找匹配用的ado+sql



原文发表于excelhome

最新附件在原文35楼

原创--输入提示自动补全,简码输入,首字母拼音输入
http://club.excelhome.net/thread-1111136-1-1.html



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ttribute VB_Name = "Module1" Option Explicit Public Declare Function GetVolumeInformation& Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) Public Const MAX_FILENAME_LEN = 256 Public Function DriveSerial(ByVal sDrv As String) As Long Dim RetVal As Long Dim Str1 As String * MAX_FILENAME_LEN Dim str2 As String * MAX_FILENAME_LEN Dim a As Long Dim b As Long Call GetVolumeInformation(sDrv & ":\", Str1, MAX_FILENAME_LEN, RetVal, a, b, str2, MAX_FILENAME_LEN) DriveSerial = RetVal End Function Public Function RegNumber(Song As String) As String Dim a Song = Val(Song) a = Mid(Song, 5, 2) Song = Song + 99 RegNumber = Song + 115478147829# ' RegNumber = "1891" & RegNumber End Function Public Function JmNumber(String1 As String) As String Dim a String1 = Val(String1) a = String1 = Mid(String1, 5, 3) String1 = String1 - 99 ' String1 = Mid(String1, 5) JmNumber = String1 - 115478147829# End Function Public Function GetPY(a1 As String) As String Dim t1 As String If Asc(a1) < 0 Then t1 = Left(a1, 1) If Asc(t1) < Asc("啊") Then GetPY = "0" Exit Function End If Rem __无法识别的汉字_____________________________________________________________________________ If a1 = "倩" Then GetPY = "Q" Exit Function End If If a1 = "铿" Then GetPY = "K" Exit Function End If If a1 = "锵" Then GetPY = "Q" Exit Function End If If a1 = "杵" Then GetPY = "C" Exit Function End If If a1 = "旮" Then GetPY = "G" Exit Function End If If a1 = "旯" Then GetPY = "L" Exit Function End If If a1 = "薇" Then GetPY = "W" Exit Function End If Rem _______________________________________________________________________________ If Asc(t1) >= Asc("啊") And Asc(t1) < Asc("芭") Then GetPY = "A" Exit Function End If If Asc(t1) >= Asc("芭") And Asc(t1) < Asc("擦") Then GetPY = "B" Exit Function End If If Asc(t1) >= Asc("擦") And Asc(t1) < Asc("搭") Then GetPY = "C" Exit Function End If If Asc(t1) >= Asc("搭") And Asc(t1) < Asc("蛾") Then GetPY = "D" Exit Function End If If Asc(t1) >= Asc("蛾") And Asc(t1) < Asc("发") Then GetPY = "E" Exit Function End If If Asc(t1) >= Asc("发") And Asc(t1) < Asc("噶") Then GetPY = "F" Exit Function End If If Asc(t1) >= Asc("噶") And Asc(t1) < Asc("哈") Then GetPY = "G" Exit Function End If If Asc(t1) >= Asc("哈") And Asc(t1) < Asc("击") Then GetPY = "H" Exit Function End If If Asc(t1) >= Asc("击") And Asc(t1) < Asc("喀") Then GetPY = "J" Exit Function End If If Asc(t1) >= Asc("喀") And Asc(t1) < Asc("垃") Then GetPY = "K" Exit Function End If If Asc(t1) >= Asc("垃") And Asc(t1) < Asc("妈") Then GetPY = "L" Exit Function End If If Asc(t1) >= Asc("妈") And Asc(t1) < Asc("拿") Then GetPY = "M" Exit Function End If If Asc(t1) >= Asc("拿") And Asc(t1) < Asc("哦") Then GetPY = "N" Exit Function End If If Asc(t1) >= Asc("哦") And Asc(t1) < Asc("啪") Then GetPY = "O" Exit Function End If If Asc(t1) >= Asc("啪") And Asc(t1) < Asc("期") Then GetPY = "P" Exit Function End If If Asc(t1) >= Asc("期") And Asc(t1) < Asc("然") Then GetPY = "Q" Exit Function End If If Asc(t1) >= Asc("然") And Asc(t1) < Asc("撒") Then GetPY = "R" Exit Function End If If Asc(t1) >= Asc("撒") And Asc(t1) < Asc("塌") Then GetPY = "S" Exit Function End If If Asc(t1) >= Asc("塌") And Asc(t1) < Asc("挖") Then GetPY = "T" Exit Function End If If Asc(t1) >= Asc("挖") And Asc(t1) < Asc("昔") Then GetPY = "W" Exit Function End If If Asc(t1) >= Asc("昔") And Asc(t1) < Asc("压") Then GetPY = "X" Exit Function End If If Asc(t1) >= Asc("压") And Asc(t1) < Asc("匝") Then GetPY = "Y" Exit Function End If If Asc(t1) >= Asc("匝") Then GetPY = "Z" Exit Function End If Else If a1 = "1" Then GetPY = "1" Exit Function End If If a1 = "2" Then GetPY = "2" Exit Function End If If a1 = "3" Then GetPY = "3" Exit Function End If If a1 = "4" Then GetPY = "4" Exit Function End If If a1 = "5" Then GetPY = "5" Exit Function End If If a1 = "6" Then GetPY = "6" Exit Function End If If a1 = "7" Then GetPY = "7" Exit Function End If If a1 = "8" Then GetPY = "8" Exit Function End If If a1 = "9" Then GetPY = "9" Exit Function End If If a1 = "0" Then GetPY = "0" Exit Function End If If UCase(a1) <= "Z" And UCase(a1) >= "A" Then GetPY = UCase(Left(a1, 1)) Else GetPY = "" End If End If End Function
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值