excel:如何将单元格内容分解为代码
有一个代码函数可以为每个字母返回 ASCII。
我想以一种将单元格 a1 = "some string"
分解
为 ASCII 代码的方式使用它:
像这样:“23423423434634
”
抱歉,我不知道确切的 ASCII,但你明白我的意思了。
请注意,我想专门使用公式而不是 VBA 来执行此操作
There is a code function that returns ASCII for every letter.
I would like to use it in a way that it will break up a cell a1 = "some string"
Into it's ASCII codes:
Something like this: "23423423434634
"
Sorry I don't know the exact ASCII of that but you get my point.
please note that i would like to do this specifically with a formula and NOT with VBA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
一种方法是使用字节数组为每个字符提供 Unicode 数字对:
One way is to use a Byte Array to give Unicode number pairs for each character:
编写 Excel 用户定义函数。
该函数的伪代码如下:
您可以调用 UDF 作为 Excel 公式的一部分,例如
公式版本
您可以使用 Excel 内置公式手动执行此操作(Excel 没有公式的 for 循环函数)
某些字符串
示例。某些字符串
示例。某些字符串
示例。某些字符串
,它将返回:单元格 K4 中的11511110910132115116114105110103
Write an Excel User Defined Function.
Pseudocode for the function is below:
You can call the UDF as part of an excell formula eg
Formula Version
You could do it manually with excel builtin formula's by (excel doesn't have a for-loop function for formulae)
some string
example.some string
example.some string
example.some string
it will return:11511110910132115116114105110103
in cell K4也许这可能对你有帮助。
问候, J'Sinh
May be this might help you.
Regards, J'Sinh
虽然它很丑陋,但如果您的字符串不太长,您可以使用一个长公式来完成它,该公式转换每个字符,然后将它们重新连接在一起。
例如,此公式可以处理长度最多为 20 个字符的字符串(创建十六进制 ascii 代码):
对于较长的字符串,您可以重复此模式,尽管您会受到 Excel 允许的最大公式长度的限制,这似乎是 8,192 个字符< /a>.
Although it's ugly, if your strings are not too long you can do it with a long formula which converts each character and then joins them back together.
For example this formula can handle strings which are up to 20 characters in length (creating hex ascii codes):
For longer strings you could repeat this pattern, although you'd be limited by the maximum formula length allowed by Excel, which seems to be 8,192 characters.