hindersaliva
asked on
Excel VBA - fill in-cell dropdown
I'm using this to loop 5 times to fill an in-cell dropdown.
But I get Runtime error 1004.
It works fine for the 1st run through the loop. I want it to ADD more items until the loop ends.
Thanks!
Sub Add_Drop_Down_Menu_Selection()
For i = 1 To 5
With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, _
Formula1:="MyData"
.IgnoreBlank = True
.InCellDropdown = True
End With
Next i
End Sub
But I get Runtime error 1004.
It works fine for the 1st run through the loop. I want it to ADD more items until the loop ends.
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.