0

I would like to understand the dynamic array initializing. In the below code why the array size is not being set even after entering the value of "y". And both Lbound and Ubound is showing as 0 even after giving values to Y as 4, 5 or anything.

Please explain this to me. Thank You.

Dim i

Redim arr(y)

y = cint(InputBox("Enter value of y"))

Msgbox Lbound(arr)

Msgbox Ubound(arr)

1 Answer 1

3

You should Redim after asking for the value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.