Sub testX()
Dim Array_Index, Array_Value
Array_Value = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
GetarrayValue Array(2, 4, 6, 8), Array_Value ' test1
GetarrayValue Array(1, 1, 1, 8), Array_Value ' test2
GetarrayValue Array(2, 1, 1, 8), Array_Value ' test3
GetarrayValue Array(2, 1, 1, 5, 8, 1, 3), Array_Value ' test4
GetarrayValue Array(2, 4, 4, 4, 3, 3, 1, 8), Array_Value ' test5
End Sub
Sub GetarrayValue(Array_Index, Array_Value)
Dim Array_Destination, Array_Indexbis
ReDim Array_Indexbis(UBound(Array_Index)): Array_Indexbis(0) = Array_Index(0)
For i = 1 To UBound(Array_Index)
Array_Indexbis(i) = IIf(Array_Index(i) = Array_Index(i - 1), Array_Indexbis(i - 1) + 1, Array_Index(i))
Next
Array_Destination = Application.Index(Array_Value, 0, Array_Indexbis)
With Cells(Rows.Count, 1).End(xlUp).Offset(1)
.Value = "(" & Join(Array_Index, ",") & ")"
.Offset(, 1).Resize(1, UBound(Array_Indexbis) + 1) = Array_Destination
End With
End Sub