Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default array inside for statement

Hello
i have an array inside a for statment and i was to reset the array everytime
the for statment run
how may i rest an array
please advice thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default array inside for statement

So you want to resize the array each time you loop? If so then take a look at
ReDim Preserve. Something like this...

Sub Tada()
Dim MyArray() As Long
Dim lng As Long

For lng = 0 To 9
ReDim Preserve MyArray(lng)
MyArray(lng) = lng
Next lng

For lng = LBound(MyArray) To UBound(MyArray)
MsgBox MyArray(lng)
Next lng
End Sub
--
HTH...

Jim Thomlinson


"Student" wrote:

Hello
i have an array inside a for statment and i was to reset the array everytime
the for statment run
how may i rest an array
please advice thank you

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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
How to write an Or statement inside Sumproduct? Bassman62 Excel Worksheet Functions 8 June 1st 09 09:04 PM
vlookup inside an if statement? carlosgdlf Excel Discussion (Misc queries) 3 August 4th 05 02:36 AM
vlookup inside an if statement? carlosgdlf Excel Worksheet Functions 3 August 3rd 05 11:38 PM
Date Format Inside of a SUMIF Statement Minitman Excel Worksheet Functions 9 June 13th 05 07:52 PM


All times are GMT +1. The time now is 05:40 PM.

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

About Us

"It's about Microsoft Excel"