ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: 游泳的人

请问汉字排序的问题?

[复制链接]

TA的精华主题

TA的得分主题

发表于 2005-4-24 14:19 | 显示全部楼层

其实可以不用字库的,用下面这个函数也可以的

function getpychar(char) tmp=65536+asc(char) if(tmp>=45217 and tmp<=45252) then getpychar= "A" elseif(tmp>=45253 and tmp<=45760) then getpychar= "B" elseif(tmp>=45761 and tmp<=46317) then getpychar= "C" elseif(tmp>=46318 and tmp<=46825) then getpychar= "D" elseif(tmp>=46826 and tmp<=47009) then getpychar= "E" elseif(tmp>=47010 and tmp<=47296) then getpychar= "F" elseif(tmp>=47297 and tmp<=47613) then getpychar= "G" elseif(tmp>=47614 and tmp<=48118) then getpychar= "H" elseif(tmp>=48119 and tmp<=49061) then getpychar= "J" elseif(tmp>=49062 and tmp<=49323) then getpychar= "K" elseif(tmp>=49324 and tmp<=49895) then getpychar= "L" elseif(tmp>=49896 and tmp<=50370) then getpychar= "M" elseif(tmp>=50371 and tmp<=50613) then getpychar= "N" elseif(tmp>=50614 and tmp<=50621) then getpychar= "O" elseif(tmp>=50622 and tmp<=50905) then getpychar= "P" elseif(tmp>=50906 and tmp<=51386) then getpychar= "Q" elseif(tmp>=51387 and tmp<=51445) then getpychar= "R" elseif(tmp>=51446 and tmp<=52217) then getpychar= "S" elseif(tmp>=52218 and tmp<=52697) then getpychar= "T" elseif(tmp>=52698 and tmp<=52979) then getpychar= "W" elseif(tmp>=52980 and tmp<=53640) then getpychar= "X" elseif(tmp>=53689 and tmp<=54480) then getpychar= "Y" elseif(tmp>=54481 and tmp<=62289) then getpychar= "Z" else '如果不是中文,则不处理 getpychar=char end if end function

function getpy(str) for i=1 to len(str) getpy=getpy&getpychar(mid(str,i,1)) next end function d="只查我的" msgbox getpy(d)

TA的精华主题

TA的得分主题

发表于 2005-4-24 16:31 | 显示全部楼层
楼上妹妹,能否给编个实例。我很烂的。

TA的精华主题

TA的得分主题

发表于 2005-4-24 19:13 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2005-4-25 00:08 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2005-4-25 09:07 | 显示全部楼层
筒子们,无法下载,请总版主、版主们重新发一下,好不/

TA的精华主题

TA的得分主题

发表于 2005-4-25 09:16 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2005-4-25 09:37 | 显示全部楼层

来生缘老师,能否劳您驾,把13楼的代码做个实例,我很烂不会呀。

[em04][em04][em04][em04][em04]

TA的精华主题

TA的得分主题

发表于 2005-4-26 18:24 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
ldhyob 斑竹将2楼的连接重发一下,无法下载!

TA的精华主题

TA的得分主题

发表于 2005-4-26 18:38 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
以下是引用6606txj在2005-4-24 16:31:00的发言: 楼上妹妹,能否给编个实例。我很烂的。

把以上代码放到模块中,然后将最后两句改成下面的,并运行,其中文字可任意更改

sub PY()

d="只查我的" msgbox getpy(d) end is

TA的精华主题

TA的得分主题

发表于 2005-4-26 21:00 | 显示全部楼层

我的一个程序不用字库就能自动生成拼音码!

在窗体的姓名文本框中输入姓名后产生姓名拼音码!如库中有重复的拼音码则提醒!

http://club.excelhome.net/viewthread.php?tid=79064

1楼

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-5-22 02:55 , Processed in 1.062379 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表