Filling an array with integer variable

  • Thread starter Thread starter Erche DP
  • Start date Start date
E

Erche DP

Hello,
I have this small scripts, and is not working since an error occured :
Expected Array!
Therefore, i am wondering, can we fill an array with an integer variable
?

private sub test ()
dim arrtemp as variant, x as integer

for i=0 to 10
arrtemp(i)=x+i 'Error!
next

end sub

Could you suggest, what to fix ?

Thanks.
 
I got a Type Mismatch error, but this worked

Dim arrtemp(0 To 10), x As Integer, i

For i = 0 To 10
arrtemp(i) = x + i 'Error!
Next


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top