ahh, sag das doch gleich
Sub InsertIntoArray(InsertArray As Variant,ArrayLen As Long,PositionToInsert As Long,ValueToInsert As String)
' this function will insert a value into an array
' Call InsertIntoArray(IniFileLines,Counter-1,Counter,INI_Section)
ArrayLen = ArrayLen + 1
Redim TempArray(ArrayLen) As String
Redim Preserve InsertArray(ArrayLen)
Dim ArrayIndex As Long
For ArrayIndex = 0 To PositionToInsert - 1 ' insert rows from InsertArray up to the PositionToInsert
TempArray(ArrayIndex) = InsertArray(ArrayIndex)
Next
' now put in ValueToInsert
TempArray(PositionToInsert) = ValueToInsert
For ArrayIndex = PositionToInsert + 1 To ArrayLen
TempArray(ArrayIndex) = InsertArray(ArrayIndex - 1)
Next
' now put values back into InsertArray
For ArrayIndex = 0 To ArrayLen
InsertArray(ArrayIndex) = TempArray(ArrayIndex)
Next
End Sub