|
▼row さん:
単純に入れ替えるだけじゃだめでしょうか?
Sub 使用例()
Dim 比較対象ファンド1 As Variant
Dim i As Long
比較対象ファンド1 = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
Call ReverseArray(比較対象ファンド1)
MsgBox Join(比較対象ファンド1, ",") '中身確認の為
End Sub
Sub ReverseArray(ByRef Ary As Variant)
Dim i As Long, j As Long
Dim AryHalf As Long, AryMin As Long, AryMax As Long
Dim Temp As Variant
AryMin = LBound(Ary)
AryMax = UBound(Ary)
AryHalf = AryMax \ 2
For i = AryMin To AryHalf
j = AryMax - i + AryMin
Temp = Ary(i)
Ary(i) = Ary(j)
Ary(j) = Temp
Next i
End Sub
|
|