excel - Right 函数是否具有通配符功能?
问题描述
我正在尝试删除以“DL1”和“DL2”和“DL3”等结尾的字符串。
我遇到了带有通配符功能的 Right 函数,但是,它不能以这种方式工作。
sub removingDL()
dim item_description as string
dim i as integer
dim x as integer
item_description = cells(i,x)
if (Right (item_description,3) = "DL?") then ' the issue is here
'remove it, let's just assume
end if
end sub
解决方案
使用Like
.
If item_description Like "*DL?" Then...
如果您打算遍历一个范围(不清楚这是否是您的最终目标),您可以AutoFilter
使用Criteria1:="=*DL?"
而不是循环。
推荐阅读
- python - Python:TypeError 参数数量错误的原因
- json - 将 JSON 数组映射到 Spring Hibernate 数据库 (H2)
- javascript - VelocityJS 2.0.5 - SkewX
- ecm - 文档未在 Opentext Archive Server 10.5 中归档
- google-chrome - org.openqa.selenium.StaleElementReferenceException / webdriver timeout execption in click action chrome drier
- laravel - laravel 通知对我不起作用
- python - 如何在 Pandas 的列子集上找到两个数据帧中行的“设置差异”?
- android - 如何控制通知组点击
- android - 应用程序被杀死时无法接收推送解析 FCM
- javascript - 将状态分配给从 json 中获取的元素