Bonjour
Le code si dessous me donne :
10 20 30 40
alors que je voudrais les index 2,4,6,8 de array value
merci
code:
Option Base 1
Sub Index_to_Value()
Dim Array_Index()
Dim Array_Value()
Dim Array_Destination()
Array_Index = Array(2, 4, 6, 8)
Array_Value = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
ReDim Array_Destination(UBound(Array_Index))
For i = LBound(Array_Index) To UBound(Array_Index)
Array_Destination(i) = Array_Value(i)
Next
[C10].Resize(, UBound(Array_Destination)) = Array_Destination
End Sub
code:
Option Base 1
Sub Index_to_Value()
Dim Array_Index()
Dim Array_Value()
Dim Array_Destination()
Array_Index = Array(2, 4, 6, 8)
Array_Value = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
ReDim Array_Destination(UBound(Array_Index))
For i = LBound(Array_Index) To UBound(Array_Index)
Array_Destination(i) = Array_Value(i)
Next
[C10].Resize(, UBound(Array_Destination)) = Array_Destination
End Sub
Le code si dessous me donne :
10 20 30 40
alors que je voudrais les index 2,4,6,8 de array value
merci
code:
Option Base 1
Sub Index_to_Value()
Dim Array_Index()
Dim Array_Value()
Dim Array_Destination()
Array_Index = Array(2, 4, 6, 8)
Array_Value = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
ReDim Array_Destination(UBound(Array_Index))
For i = LBound(Array_Index) To UBound(Array_Index)
Array_Destination(i) = Array_Value(i)
Next
[C10].Resize(, UBound(Array_Destination)) = Array_Destination
End Sub
| | | |
code:
Option Base 1
Sub Index_to_Value()
Dim Array_Index()
Dim Array_Value()
Dim Array_Destination()
Array_Index = Array(2, 4, 6, 8)
Array_Value = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
ReDim Array_Destination(UBound(Array_Index))
For i = LBound(Array_Index) To UBound(Array_Index)
Array_Destination(i) = Array_Value(i)
Next
[C10].Resize(, UBound(Array_Destination)) = Array_Destination
End Sub