Need help with sorting of three columns

G

Guest

Hi!
I have 3 columns. This is an example:

column 1: column 2:
column 3:

Postoffice1 salesman 1 1
Postoffice1 salesman 1 4
Postoffice1 salesman 1 1
Postoffice2 salesman 1 2
Postoffice3 salesman 2 2
Postoffice4 salesman 1 3

This is the result I want:
Postoffice1 salesman 1 6
Postoffice2 salesman 1 2
Postoffice3 salesman 2 2
Postoffice4 salesman 1 3

I have a VBA code for removing dublicates for the first column but I don't
really know how to fix the rest.

I appriciate all help
Regards Calle
 
G

Guest

Hmm I try to describe it a bit better:

column 1:----------- column 2:----------- column 3:

Postoffice1 --------salesman#1 ---------------1
Postoffice1 --------salesman#1 --------------4
Postoffice1 --------salesman#1 --------------1
Postoffice2 --------salesman#1 --------------2
Postoffice3 --------salesman#2 --------------2
Postoffice4 --------salesman#1 --------------3

This is the result I want:
Postoffice1 --------salesman#1 --------------6
Postoffice2 --------salesman#1 --------------2
Postoffice3 --------salesman#2 --------------2
Postoffice4 --------salesman#1 --------------3
 
G

Guest

hi!
The thing is that these colums will change all the time since they are being
imported from different excel workbooks... Can I still use a pivot table?
 
C

Carim

Yes ...

A simple "Refresh" will automatically update the pivot table ...


HTH
Carim
 
G

Guest

I see one problem... The colums will be different in length. Don't I have to
define the size of the pivot table
 
C

Carim

A range can be defined "dynamically", i.e it will automatically adjust
itself ...
such as follows :

=Offset(Sheet1!$A$1,0,0,CountA(Sheet1!$A:$A),CountA(Sheet1!$1:$1))

Carim
 
G

Guest

Hi Carim!

The pivot table worked out nice. I just have one more question. I want to
display the data/colums from the pivot table on another sheet butwithout
making a new pivot table on that sheet (layout isue ). I would prefer a macro
so I can creat a button that on click import data from the pivot table... Any
suggestions?
 
C

Carim

If you are creating a new worksheet just for "cosmetic" reasons, there
are 2 possibilities :
1. Customise your pivot table and preserve format ,or,
2. A new sheet just refering to the pivot table worksheet, i.e for each
cell
= respective cell of the pivot table

HTH
Carim
 
G

Guest

well since the lenght of the pivot table will change all the time I can't
refer to the table for every cell
 

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