Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
For ループで Each キーワードを使用して配列に値を入力しようとしていますが、以下のコードでは実行できませんでした。以下のコードのエラーを理解するのに役立ちます。
Dim Arr(4) For Each Element in Arr Element = InputBox("Enter Data") Next 'Nothing is getting stored in the Array: Arr()
For Each (*) から返されたインデクサーを使用して配列要素を設定することはできないため、代わりに次のようにする必要があります。
Dim Arr(4) For i = 0 to 4 Arr(i) = InputBox("Enter Data") Next For Each Element in Arr MsgBox Element Next
(*) 実際の値のコピーだと思います