「Excel VBA」配列の要素をコピーするサンプル
使用例
Sub sampleFunc() Dim cftA As Variant Dim cftB As Variant cftA = Array("AA01", "BB02", "CC03") '配列をコピーする cftB = cftA cftB(0) = "DD04" Debug.Print cftB(0) 'DD04 Debug.Print cftB(1) 'BB02 Debug.Print cftB(2) 'CC03 Debug.Print cftA(0) 'AA01 Debug.Print cftA(1) 'BB02 Debug.Print cftA(2) 'CC03 End Sub