vba - .查找多次
问题描述
所以我需要做一个.Find,如果为真,则将值返回到一个单元格中,然后再做一个.Find。到目前为止,我为 Text1 工作,但随后为 Text2 返回 False。是否认为我需要以某种方式重置 .Found 值?
With wrdDoc
With .Range.Find
.MatchWholeWord = True
.Text = "text1"
.Execute
If .Found = True Then
Cells(resultRow, 1).Value = strFileName
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Text = "text2"
.Execute
If .Found = True Then
MsgBox "This document contains the word2"
我对此有点陌生,所以我一定只是错过了一些关于 .Range.Find 的规则
解决方案
推荐阅读
- flutter - 如何修复错误以使用 Firestore 填充下拉按钮
- powershell - Terraform,从powershell gridview中选择值
- javascript - 裁剪时图像居中问题
- mongodb - 在 mongoDB 中的另一个数组中查询整个特定数组
- android - 如何通过移动角来调整多边形的形状
- c# - 单例实例不会覆盖和清空 getter setter
- powershell - 将文件夹移动到父文件夹并附加父名称
- excel - 重复计算 n 次
- python - hvplot - 如何通过分类变量为点数据着色并与 `ds.count_cat(.)` 聚合
- excel-2016 - EXCEL:如何直接从表中获取特定值,而不使用 INDEX