Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Filling an array with integer variable



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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Filling an array with integer variable

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)

"Erche DP" wrote in message
...


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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling in color in a box based upon a variable . Dan C Excel Worksheet Functions 1 December 24th 07 01:46 PM
How to specify a Range which includes an integer variable Hotbird[_3_] Excel Programming 4 May 7th 04 02:38 PM
Is variable an integer? Otto Moehrbach[_6_] Excel Programming 7 February 6th 04 04:31 PM
OutlineLevel and Integer Variable issue jurgenC![_2_] Excel Programming 2 January 30th 04 10:32 PM
Use of integer variable for sizing of matrix Cor Steeghs Excel Programming 2 August 8th 03 12:56 PM


All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"