使用vba从文本中删除不可见的问号 - #E
我必须从 Excel 列的单元格中读取文本并在另一张工作表中搜索它。
例如,sheet1 列 A 中的文本是“诱发电位幅度 N2 - P2”。必须在sheet2 列C 中搜索。此操作失败,因为“E”之前出现一个问号,而sheet2 中的值中不存在该问号。
两者都是同一角色在不同应用程序中的表示。也许有人会认出它。
在 Excel 工作表中,我没有看到任何垃圾字符,但在 vb 代码中处理它时,我在单词 Evoke 之前看到一个问号。
该数据是从共享点应用程序中提取的,并且该字符(?)对于普通人来说是不可见的。在这种情况下,搜索和替换功能不起作用。
I have to read the text from the cells of a column in excel and search for it in another sheet.
say for example, the text in sheet1 column A is "Evoked Potential Amplitude N2 - P2." This has to be searched in sheet2 column C. This fails because a question mark appears before the "E" which is not present in the value in the sheet2.
Both are representation of same character in different application. Maybe someone might recognize it.
In the excel sheet I don't see any junk characters, but while handling it in the vb code I see a question mark before the word - Evoke.
This data was extracted from a share point application and this character (?) is not visible to the plain eye. Search and replace functions are not working in this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Unicode 8203 是零宽度空格。我不确定它是从哪里来的。这可能是数据导入 Excel 的方式存在缺陷,您以前没有注意到,但它可能值得修复。
同时,您可以简单地使用 Excel VBA 中的 Mid() 函数来删除不需要的字符。例如,不要
使用
删除第一个字符的方法。
Unicode 8203 is a zero-width space. I'm not sure where it's coming from. It is probably a flaw in the way the data is imported into Excel which you haven't noticed before, but it might be worth fixing.
In the meantime, you can simply use the Mid() function in Excel VBA to remove the unwanted character. For example instead of
use
which deletes the first character.