Excel VBA-Dynamic array introduction.

Published: 10 May 2020
on channel: VBA Learning tutorials
164
5

Excel VBA-Dynamic array introduction

Option Explicit
Option Base 1
Sub CreateDynamicArray()

Dim myarr() As Variant

ReDim myarr(2) As Variant
myarr(1) = "John"
myarr(2) = "142"

ReDim Preserve myarr(4)
myarr(3) = "Sinha"
myarr(4) = Now

Erase myarr()

End Sub

Sub DynamicArrayExample()

Dim arr() As Variant
Dim i As Integer
ReDim arr(1) As Variant
arr(1) = 125

ReDim Preserve arr(3) As Variant
arr(2) = "Akash"
arr(3) = Date

For i = LBound(arr()) To UBound(arr)
MsgBox arr(i)
Next i
End Sub


On this page of the site you can watch the video online Excel VBA-Dynamic array introduction. with a duration of hours minute second in good quality, which was uploaded by the user VBA Learning tutorials 10 May 2020, share the link with friends and acquaintances, this video has already been watched 164 times on youtube and it was liked by 5 viewers. Enjoy your viewing!