Insert the following code as module into your workbook:
Rich (BB code):
Option Explicit
Function ArrayUnion(ParamArray Arg() As Variant) As Variant
' Code: Juan Pablo González
' Spec: Aladin Akyurek
' May 4, 2003
' Ref: http://makeashorterlink.com/?P20022174
' Mod: Nov 3, 2003, to reduce number of ReDim Preserve calls.
Dim TempUnion() As Variant
Dim i As Long, Itm As Variant, Ctr As Long
ReDim TempUnion(1 To UBound(Arg) - LBound(Arg) + 1) As Variant
For i = LBound(Arg) To UBound(Arg)
Arg(i) = Arg(i)
If IsArray(Arg(i)) Then
For Each Itm In Arg(i)
Ctr = Ctr + 1
If Ctr > UBound(TempUnion) Then
ReDim Preserve TempUnion(1 To UBound(TempUnion) * 2) As Variant
End If
'ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Itm
Next Itm
Else
Ctr = Ctr + 1
If Ctr > UBound(TempUnion) Then
ReDim Preserve TempUnion(1 To UBound(TempUnion) * 2) As Variant
End If
'ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Arg(i)
End If
Next i
If Ctr< UBound(TempUnion) Then
ReDim Preserve TempUnion(1 To Ctr) As Variant
End If
ArrayUnion = TempUnion
End Function
Insert a new worksheet and name it Admin...
Let the values in D6, D7, and G3 on Sheet1 be: Don, Jim, and Damon.
Admin
Activate Insert|Name|Define.
Enter
List as name in the Names in Workbook box.
Enter the following in the Refers to box:
=arrayunion(Sheet1!$D$6:$D$7,Sheet1!$G$13)
Click OK.
In A1 on Admin enter:
=COUNTA(List)
In A2 enter & copy down:
=IF(ROW()-ROW($A$2)+1<=$A$1,INDEX(List,ROW()-ROW($A$2)+1),"")
Activate Insert|Name|Define.
Enter
SList in the Names in Workbook box.
Enter the following in the Refers to box:
=Admin!$A$2:INDEX(Admin!$A:$A,MATCH("*",Admin!$A:$A,-1))
Click OK.
Now you can use SList as source in any appropriate cell in your workbook you want to data validate.