我目前正在使用VBA中的搜索功能,它将从搜索范围中获取结果并将单元格位置的地址输入到数组中。我试图用下面的代码设置数组。VBA ::将范围结果传递到数组
Dim FindRange1 as Range
Dim Find1 as Range
Dim Results1() as Variant
Dim R1 as integer
Dim Max as integer
Max = Range("E7:E1000").Cells.Count
Set FindRange1 = Worksheets("Properties").Range("P7:P1000")
If ILsearch.P1B1.Value = True Then
For R1 = 1 To Max
For Each Find1 In FindRange1
If (Find1.Value < TextBox1) And (Find1.Value > "0") Then
Results1(R1) = Find1.Address
End If
Next Find1
Next R1
End If
那么问题是什么?你不期望它做什么? – jonsca