Excel VBA-删除* word *之后的字符串内容 [英] Excel VBA - delete string content after *word*

查看:115
本文介绍了Excel VBA-删除* word *之后的字符串内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除字符串中包含的某个单词之前的字符串内容.例如

I'm trying to delete string content before a certain word contained within the string. For example

master_of_desaster@live.de

我想使用VBA替换为

master_of_desaster

应该删除单词"(@)之后的所有内容,包括单词"本身.

Everything after the "word" (@) should be removed, including the "word" itself.

我在在这里找到了类似的主题,但他提出了相反的要求.

I found a similar topic here, but he asks the opposite.

推荐答案

email = "master_of_desaster@live.de"

ret = Left(email, InStr(1, email, "@") - 1)

结果:master_of_desaster

Result: master_of_desaster

感谢 Shai Rado

这篇关于Excel VBA-删除* word *之后的字符串内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆