更新下拉列表循环

Updating drop down list loop

我正在尝试创建一个列表,该列表在数据库中检查所需名称,然后将该项目添加到下拉列表中。到目前为止,我使用的代码在检查名称时起作用,但随后会覆盖列表中的所有先前条目。我该如何更改,以便它在每次找到正确的数据时都添加一个新的列表项?

While ThisWorkbook.Worksheets("Inventory Database").Range("A" & j).Value <> ""
If ThisWorkbook.Worksheets("Inventory Database").Range("A" & j) = ThisWorkbook.Worksheets("Equipment Availability").Cells(1, i) Then
dvList = ThisWorkbook.Worksheets("Inventory Database").Range("B" & j)

'~~> Creates the list 
With Sheets("Equipment Availability").Cells(2, 2).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
    xlBetween, Formula1:=dvList
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
End With
End If
j = j + 1
Wend    

您应该只创建一次验证列表,同时引用一个命名范围。如果您在每个循环中扩展命名范围(添加新值),则验证列表将自动更新。