If you do not want to add an element to the array that you have, you will have to loop through the whole array, checking to see if you have the customer you want to 'delete'. When you have found the customer to delete, move the next customer into this element and then continue moving the customers up one position. Afterwards Redim Preserve the array to get rid of the unwanted element from the end of the array.
EG
Create a project and put a text box and button on a form. Paste the following code into the general declarations of the form:
Dim arrCustomers() As String
Private Sub Command1_Click()
Dim strCustomer As String
Dim i As Integer
Dim sMsg As String
Dim bFound As Boolean
strCustomer = "Cust" & Val(Text1.Text)
MsgBox "Delete " & strCustomer
For i = LBound(arrCustomers) To UBound(arrCustomers)
If i = UBound(arrCustomers) Then
If bFound Or strCustomer = arrCustomers(i) Then
arrCustomers(i) = ""
bFound = True
End If
Else
If Not bFound Then
If arrCustomers(i) = strCustomer Then
arrCustomers(i) = arrCustomers(i + 1)
bFound = True
End If
Else
arrCustomers(i) = arrCustomers(i + 1)
End If
End If
Next i
If bFound Then
ReDim Preserve arrCustomers(UBound(arrCustomers) - 1)
End If
For i = LBound(arrCustomers) To UBound(arrCustomers)
sMsg = sMsg & Chr(13) & i & ", " & arrCustomers(i)
Next i
MsgBox sMsg
End Sub
Private Sub Form_Load()
Dim i As Integer
Dim sMsg As String
For i = 0 To 10
ReDim Preserve arrCustomers(i)
arrCustomers(i) = "Cust" & i
Next i
For i = LBound(arrCustomers) To UBound(arrCustomers)
sMsg = sMsg & Chr(13) & i & ", " & arrCustomers(i)
Next i
MsgBox sMsg
End Sub
To use the program, type a number (initially 0 to 10) into the text box and click the button. The code behind the button does the removing part.
Hope this helps,
Simon [sig][/sig]