Das mag als ein BEISPIEL dienen - arbeitet nur mit Strings, entfernt dafür den gesuchten String, auch wenn er mehrfach im Array vorkommt.
HTH,
Bernhard
Function DeleteMember(vMemberToDelete As Variant, vInitialList As Variant) As Variant
'==============================================================================
' Purpose: eliminate one value from a list of strings.
' ------------------------------------------------------------------------------------------------------------------------------------------------------------
' Arguments: Type Obs
' vMemberToDelete | I/- | Unneeded element, the one that will dessapear from the list
' vInitialList | I/- | Initial list, witch contains that element
' ------------------------------------------------------------------------------------------------------------------------------------------------------------
' Return: list without the element
' ------------------------------------------------------------------------------------------------------------------------------------------------------------
' Created by: Cristi Voica on 04.07.2000 Modified by: Bernhard Koehler on 17.12..2002
'==============================================================================
Dim vFinalList () As Variant
Dim i As Integer
On Error Goto ErrorRoutine
If Isempty (vInitialList) Then
DeleteMember = ""
Exit Function
End If
If Isscalar (vInitialList) Then
If vInitialList = "" Then
DeleteMember = ""
Exit Function
Else
DeleteMember = vInitialList
Exit Function
End If
End If
i = 0
Forall member In vInitialList
If Not (member = vMemberToDelete) Then
Redim Preserve vFinalList(i) As Variant
vFinalList(i) = member
i = i +1
End If
End Forall
If (i > 0) Then DeleteMember = vFinalList
Exit Function
ErrorRoutine:
Call DisplayErrMsg ("DeleteMember")
Exit Function
End Function