我目前正在使用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