LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default ReDim ArrayXY

First of all thanks in advance for the help. I really appreiate it.

Here's the story:

In each of the "else if" (see below) there is ReDim Arrayxyz(i).
This works fine, but with one problem: if the original array had 12
elements in it, the data in those 12 will be deleted; however, the
new array will start at element 13. - this grows and grows as the
loop reitterates-

My desire is for the new array to start at element 0 (or 1).

Basicly, I am going to take the info from the array, populate a
separate worksheet with it, and then contiue proceduring through this
data, over and over again.


current_s= Range("B2").Value
C_V= Range("F2").Value
sk_cc = 1
currentlastrow = Range("B65536").End(xlUp).Row
currentlastcol = Range("A1").End(xlToRight).Column
j = 2
myFlaag = False
ifMatch = False
Range("A1").Select


For i = Range("B2").Row To currentlastrow Step 1
h = i


If Range("B" & i).Value = current_s Then
ifMatch = True
ReDim Preserve Arrayxyz(i)
Arrayxyz(i) = Range("F" & i).Value

If Range("F" & i).Value = "AL P&V" Then
myFlaag = True
bzp_p = Range("I" & i).Value
End If


ElseIf myFlaag = True Then
lowpe = Application.Min(Range("I" & j, "I" & (i - 1)))
percentAbv = (bzp_p - lowpe) / lowpe
i = i - 1
j = i
myFlaag = False
ReDim Arrayxyz(i)


ElseIf myFlaag = False Then
i = i - 1
ReDim Arrayxyz(i)

End If


ActiveCell.Offset(1, 0).Select
current_s= Range("B" & h).Value
Next

 
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
ReDim Array Brandt Excel Programming 3 October 9th 06 06:42 PM
ReDim Matrix Arne Hegefors Excel Programming 1 August 22nd 06 10:09 AM
ReDim Array Viktor Ygdorff Excel Programming 2 July 10th 06 04:04 PM
Dim and Redim Sean Excel Programming 4 June 5th 06 07:31 PM
redim preserve [email protected][_2_] Excel Programming 3 December 15th 05 01:40 PM


All times are GMT +1. The time now is 10:25 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"