VBA Excel:查找多个值&将匹配的值返回到下一个单元格

发布于 2024-12-21 08:38:58 字数 980 浏览 3 评论 0原文

这个问题对应于这个链接 VBA Excel:提取数据采用 CSV 文件的特定格式

但我这里有一个不同的问题。

在 CVS 文件中,在 C 列中充满了有关 Windows XP、Adobe、Office、.net Framework、vlc 等应用程序软件的信息...所以,在 C< /code> 我有大约 1800 行。

我想在每个 & 中查找 Windows XP、Adobe、IBM、VLC 等。每个列单元格或整个列中如果存在匹配项,则将匹配值粘贴到下一列单元格中。

例如,如果找到“Adobe”,则将“Adobe”粘贴到下一个列单元格。

我如何使用 ìfLookup 执行,或者有什么最好的方法吗?

if(FIND("Adobe",C:C),"TRUE","FALSE")

=Lookup(Windows XP, C:C) 将返回“Windows XP” =Lookup(Adobe, C:C) 将返回“Adobe” =Lookup(IBM, C:C) 将返回“IBM”

我已在此处上传了 CVS 文件!

http://uploadmb.com/freeuploadservice.php?uploadmbID=1324042163&srv=www&filename=5200.csv

This question is corresponding to this link VBA Excel : Extract data in specific format from CSV files

but i have a different problem here.

In CVS file, In the col C full of information about application softwares like Windows XP, Adobe, Office, .net Framework, vlc, etc.... So, in the col C i have around >1800 lines.

I want to look for Windows XP,Adobe, IBM, VLC etc in each & every col cell or in the entire col if there a match then paste the match value in the next column cell.

For example, if "Adobe" found then paste "Adobe" to the next col cell.

How can i perform using ìf or Lookup or is there any best way??

if(FIND("Adobe",C:C),"TRUE","FALSE")

=Lookup(Windows XP, C:C) would return "Windows XP"
=Lookup(Adobe, C:C) would return "Adobe"
=Lookup(IBM, C:C) would return "IBM "

I have uploaded the CVS file here!!

http://uploadmb.com/freeuploadservice.php?uploadmbID=1324042163&srv=www&filename=5200.csv

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花开半夏魅人心 2024-12-28 08:38:58

您可以使用 D 列中的公式来检查“Windows XP”或您想要查找的任何数据:

=IF(ISERROR(FIND("Windows XP",C2)),"","Windows XP")

Jesse

You could use a formula in column D to check for "Windows XP" or whatever data you're trying to find:

=IF(ISERROR(FIND("Windows XP",C2)),"","Windows XP")

Jesse

过度放纵 2024-12-28 08:38:58
Sub AddFormula()
    Dim lLR As Long
    lLR = Range("A" & Rows.Count).End(xlUp).Row
    Range("D2").FormulaArray = "=INDEX($E$2:$E$15,MATCH(1,--ISNUMBER(SEARCH($E$2:$E$15,$C2,1)),0),1)"
    Range("D2").AutoFill Destination:=Range("D2:D" & lLR)

这个公式代码工作正常。

Sub AddFormula()
    Dim lLR As Long
    lLR = Range("A" & Rows.Count).End(xlUp).Row
    Range("D2").FormulaArray = "=INDEX($E$2:$E$15,MATCH(1,--ISNUMBER(SEARCH($E$2:$E$15,$C2,1)),0),1)"
    Range("D2").AutoFill Destination:=Range("D2:D" & lLR)

This formula code works fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文