Lasse ich ReDim Preserve arr(n) weg, dann wird das Dropdown nicht befüllt, aber es kommen keine o.g. Fehlermeldungen mehr. Kann man mir helfen, bitte? Gibt es eine andere Möglichkeit, das Dropdown aus einer Tabellenspalte zu befüllen. Ich bedanke mich.
Sub DatenausTabinDropdown()
On Error Resume Next
Dim axx As Variant
Dim arr() As Variant
Dim i As Long
Dim n As Variant
axx = Application.WorksheetFunction.CountA(Sheets("Lager").Range("A1:A10000"))
For i = 1 To axx
n = n + 1
ReDim Preserve arr(n)
arr(n) = Sheets("Lager").Cells(i, 1).Value
Next i
Range("A1:A10").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, Formula1:=Join(arr, ",")
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub