gpt4 book ai didi

algorithm - 用于提取特定行的 Excel 公式

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:34:26 24 4
gpt4 key购买 nike

我有一个庞大的数据集,我想提取没有特定关键字的行。

例如,假设我有以下数据集(两列):

+--------------+------------------+ 
| Nylon | Nylon wire |
| Cable | 5mm metal cable |
| Epoxy | some comment |
| Polyester | some comment |
+--------------+------------------+

我想找到不包含关键字 Nylon 和 Epoxy(以及与此相关的其他关键字)的行,并将这些行放在另一个地方(即工作表)。

提前致谢!

最佳答案

Sub a()
With Worksheets(1)
j = 1
For i = 1 To .UsedRange.Rows.Count
If .Rows(i).Find(what:="Nylon") Is Nothing And .Rows(i).Find(what:="Epoxy") Is Nothing Then
.Rows(i).Copy Destination:=Worksheets(2).Rows(j)
j = j + 1
End If
Next i
End With
End Sub

关于algorithm - 用于提取特定行的 Excel 公式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5347033/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com