Reputation: 35
I am beginner in vba, I can’t understand the below code even I searched a lot about it and didn’t find any thing. What is the meaning of put (x) and declare it with different type?
Const x = 25
Dim y(x) As Double
Dim z(x) As Boolean
Any hlep will be appreciation
Upvotes: 1
Views: 895
Reputation: 1605
This is declaring an array with the same amount of values as x as the specified type
Const x = 25
Dim y(x) As Double = array of 25 double
Dim z(x) As Boolean = array of 25 booleans
Upvotes: 1
Reputation: 281875
y
and z
are arrays, each with 25 elements.
y
is an array of 25 Double
s and z
is an array of 25 Boolean
s.
There are any number of VBA tutorials that will teach you about arrays; here's one example: Array in Excel VBA
Upvotes: 3