-3

how to create array and display required array value. For example:

Arr[0]="anand" Arr[1]="bala".print Arr optin:2, Bala .

i need the required array output

1
  • 1
    Did you even bother to search first? Commented Apr 23, 2017 at 19:38

1 Answer 1

0

Queat seems a bit unclear. May be below piece of code can be relevent to your Question.

'Initializing & Filling up array
Dim testArr(3)
testArr(0)="First"
testArr(1)="Second"
testArr(2)="Third"

Dim Iterator,userInput

'If you Need ro validate the User input you need to use Err Object.
'Like if it's number or not/Is teh User Provided value is positive or not/ etc. etc. which i'm not doing now)

userInput=Cint(inputbox("Please enter a Positive number between 1-" & Ubound(testArr)))

If userInput<=Ubound(testArr) Then
   MsgBox(testArr(userInput-1))
Else
    MsgBox("Wrong Value Provided. Not Applicable Array Index Number !!!")
End If      
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.