View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Array instead of loop I'm sure

Hi Claus,

Thanks for taking the time to do the code.

Changed this

For i = 1 To UBound(varCheck)

To this

For i = 0 To UBound(varCheck)

It was missing the first index number.

Seems to work well.
Much faster than the loop of course.

The list in column A are unique values, and I believe they all occur in C1:HQ950. (a little range change, I was missing some data)


The worksheet of data is a horrible layout, although it makes sense to the user as it is a "map" of locations of equipment placed in a solar panel field. So the "blocks" of data on the sheet are in the same relation to each other as they are in the field, on the ground in real life.

Checking results is nearly impossible.

The further problem is transferring the data to a separate sheet to produce a more viewable and verifiable set of data.

The code puts the index number in the left most cell of a row of 22 serial numbers. With two different formats.

Some are like this:

1-1-1-2 x x x x x x x x x x x x x x x x x x x x x x

Some are like this:

1-1-1-3 x x x x x x x x x x x
x x x x x x x x x x x

So there are some index numbers followed by 22 serial numbers (23 cells)

And some index numbers followed by 11 serial numbers in two rows.

On Sheet New List is the goal to list like this.

1-1-1-1 x x x x x x x x x x x x x x x x x x x x x x
1-1-1-2 x x x x x x x x x x x x x x x x x x x x x x
1-1-1-3 x x x x x x x x x x x x x x x x x x x x x x
..
..
etc. for 1800+
..
..
4-14-5-5 x x x x x x x x x x x x x x x x x x x x x x
4-14-5-6 x x x x x x x x x x x x x x x x x x x x x x
4-14-5-7 x x x x x x x x x x x x x x x x x x x x x x

If they were all on a single row, I could do another loop to "find - resize -copy - xlEndUp(2)" to Sheet New List.

I can't figure out how to make a code know if it is working with a single 22 cell range or if it is a two row 12-x-11 cell range.

Howard