My code-
For i= 1 to 10
str & i = InputBox("Enter a number")
Next i
The problem is that it does not create the variable and highlights the “&” sign. Please help.
P.S. I dont want to use an array.
Edit (Updated requirement from one of the comments):
I can’t use an array because its for a school project and i’m not allowed, and the user can enter as many numbers as he wants to, so..?
As Marco says, you can’t have variable variables.
Sounds like you need an array instead:
UPDATE: Answering requirements of unknown number of inputs, and absence of arrays:
You can possibly use a collection, as this will take new inputs as you require: