我正在遍历一列,并希望捕获与要搜索的文本字符串匹配的单元格。当我尝试将满足搜索条件的单元格的地址设置为Range对象时,就会出现我的问题。线: 设置testRng = i.Range.Adress 给我错误“参数数量错误或属性分配无效”,我不确定这里的问题是什么?
这是我正在使用的全部代码:
Sub Tester()
Dim rng As Range
Dim testRng As Range
Dim i As Variant
Dim cmpr As String
Dim usrInputA As String
usrInputA = InputBox("Col 1 Criteria: ")
Set rng = Range("A2:A10")
For Each i In rng
cmpr = i.Value
If InStr(cmpr, usrInputA) Then
If testRng Is Nothing Then
Set testRng = i.Range.Address
Else
Set testRng = testRng & "," & i.Range.Address
End If
Else
MsgBox "No hit"
End If
Next
End Sub
答案 0 :(得分:2)
_expandAttributes()
声明为 static _expandAttributes(options) {
if (_.isPlainObject(options.attributes)) {
let attributes = Object.keys(this.rawAttributes);
if (options.attributes.exclude) {
attributes = attributes.filter(elem => {
return options.attributes.exclude.indexOf(elem) === -1;
});
}
if (options.attributes.include) {
attributes = attributes.concat(options.attributes.include);
}
options.attributes = attributes;
}
}
(不是i
)Range
将一组单元格分组在一起,而不是尝试自己手动构建字符串Variant
一次,因此我将其放在底部,这样您就不必继续发送垃圾邮件了。Union