答案1
我现在发现我可以使用 ArrayUnionhttp://www.mrexcel.com/forum/excel-questions/691533-combine-two-named-ranges-into-3rd-named-range.html
Function ArrayUnion(ParamArray Arg() As Variant) As Variant ' Code: Juan Pablo González ' Spec: Aladin Akyurek ' May 4, 2003 ' Ref: TinyURL.com - shorten that long URL into a tiny URL Dim TempUnion() As Variant Dim i As Long, Itm As Variant, Ctr As Long 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 ReDim Preserve TempUnion(1 To Ctr) As Variant TempUnion(Ctr) = Itm Next Itm Else Ctr = Ctr + 1 ReDim Preserve TempUnion(1 To Ctr) As Variant TempUnion(Ctr) = Arg(i) End If Next i ArrayUnion = TempUnion End Function