LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Increment an Array question

Have seen both your replies and Jim's. Thanks to you both. It is a segment
in a bigger series of routines.
I still cannot see the error(s).

Will try to create a simple set of data, with the relevent
code routine and post back.

Regards and thanks.

"Tom Ogilvy" wrote in message
...
If can do two things
if the first element is empty, it writes the range value in the first
element.

otherwise, it increases the upperbound of the array by one and writes it
in
the new element.


I am not sure what role "i" plays, but you increment that and don't use
it.

If StartRw is not being incremented, then you would write the same value
in
every element.

I find that the following code is overwriting varr(1) each time


Not unless .Range("B" & StartRw) is empty and you are placing an empty
value
in varr(1)

--
Regards,
Tom Ogilvy



"S G Booth" wrote in message
...
I'm searching up a column looking for a particular value.
When found, I need to add a range offset from that cell
to an array.
I find that the following code is overwriting varr(1) each
time....so the array never builds correctly
i = i + 1
If IsEmpty(varr(1)) Then
Set varr(1) = .Range("B" & StartRw)
Else
ReDim Preserve varr(1 To UBound(varr) + 1)
Set varr(UBound(varr)) = .Range("B" & StartRw)
End If

Why is the array not building correctly, please?

Regards






 
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
Array Question Larry L Excel Discussion (Misc queries) 16 January 20th 09 08:25 AM
array question Len Case Excel Worksheet Functions 3 December 17th 07 09:48 PM
Array Question keeblerjp Excel Discussion (Misc queries) 4 June 20th 06 04:21 PM
Increment array for debits and credits MarcB[_2_] Excel Programming 0 July 14th 04 07:03 AM
Increment array range MarcB[_2_] Excel Programming 0 June 23rd 04 05:29 PM


All times are GMT +1. The time now is 11:39 AM.

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"