Excel VBA使用通配符替换字符串中的字符串

编程入门 行业动态 更新时间:2024-10-25 19:25:27
本文介绍了Excel VBA使用通配符替换字符串中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我处境艰难,迄今为止找不到解决办法的运气.

I have a difficult situation and so far no luck in finding a solution.

我的VBA收集了像 $ 80,000.50 这样的数字.我试图让VBA删除最后一个句点,使其看起来像 $ 80,000.50 ,但未使用right()

My VBA collects number figures like $80,000.50. and I'm trying to get VBA to remove the last period to make it look like $80,000.50 but without using right().

问题是在上一时期之后有隐藏的空格或字符,这将要处理很多新问题,所以我只是在寻找类似的东西

The problem is after the last period there are hidden spaces or characters which will be a whole lot of new issue to handle so I'm just looking for something like:

replace("$ 80,000.50.",.**.",.**")

在VBA中可以吗?

推荐答案

我无法发表评论,所以....

I cant leave a comment so....

InStrRev呢?

what about InStrRev?

Private Sub this() Dim this As String this = "$80,000.50." this = Left(this, InStrRev(this, ".") - 1) Debug.Print ; this End Sub

更多推荐

Excel VBA使用通配符替换字符串中的字符串

本文发布于:2023-10-24 14:55:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524236.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   通配符   Excel   VBA

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!