ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with sorting of three columns (https://www.excelbanter.com/excel-programming/374636-need-help-sorting-three-columns.html)

Calle

Need help with sorting of three columns
 
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


Calle

Need help with sorting of three columns
 
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

Carim

Need help with sorting of three columns
 
Hi,

The easiest and quickest way is to build a simple pivot table.

HTH
Carim


Calle

Need help with sorting of three columns
 
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?

Carim

Need help with sorting of three columns
 
Yes ...

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


HTH
Carim


Calle

Need help with sorting of three columns
 
And it's possible to refresh via a VBA macro

Calle

Need help with sorting of three columns
 
I see one problem... The colums will be different in length. Don't I have to
define the size of the pivot table

Carim

Need help with sorting of three columns
 
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),Count A(Sheet1!$1:$1))

Carim


Calle

Need help with sorting of three columns
 

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?

Carim

Need help with sorting of three columns
 

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


Calle

Need help with sorting of three columns
 
well since the lenght of the pivot table will change all the time I can't
refer to the table for every cell


All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com