Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Need help with sorting of three columns

Hi,

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

HTH
Carim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Need help with sorting of three columns

Yes ...

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


HTH
Carim



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Need help with sorting of three columns

And it's possible to refresh via a VBA macro
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default 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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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?
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default 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



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
Reply
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
freezing columns labels while sorting columns Stan New Users to Excel 1 December 3rd 09 11:30 AM
sorting columns dean d. New Users to Excel 1 May 6th 08 05:21 PM
help with sorting text in columns to match other columns rkat Excel Discussion (Misc queries) 1 August 11th 06 03:42 AM
Sorting on columns AMH Excel Worksheet Functions 1 July 18th 06 04:49 PM
Sorting columns Petterq Excel Worksheet Functions 2 October 10th 05 08:20 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"