Consolidate ...problem

A

Arishy

Public Sub consolidatewithatwist()
Dim myArray As Variant

Sheets("aaa").Range("a25:f32").Name = "Rng1"
Sheets("bbb").Range("a25:f32").Name = "Rng2"
Sheets("ccc").Range("a25:f32").Name = "Rng3"


myArray = Array("Rng1", "Rng2", "Rng3")

Sheets("AveragePriceFlowers").Select
Range("A10").Select
Cells.Clear
Range("a10").Consolidate Sources:=myArray, Function:=xlSum,
TopRow:=True, LeftColumn:= _
True, CreateLinks:=False


End Sub

Each range(Identical) consists of
ItemCode/Description/field3/field4/field5/Quantity
Variable rows between 3-10 rows

Here what I get

The items summarized correctly ie I get "unique" item codes
The quantity field summarized correctly
The Description Dissapears from all summarized rows
Also I get Fields3-5 Also summed.

Is this the expected behaviour ? and how I can get the description And
prevent fields3-5 from being summarized Examples of these fields: unit
price !!! no sense getting a sum for ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top