Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Merge and Sum Rows


Hi, I'm a relative newbie to Macros and this is my first posting

I have created a macro which extracts data from other spreadsheets into
one master spreadsheet but I need help to then automatically tidy up the
results

The spreadsheet contains several columns over several hundred rows. The
first few columns of each row contain data e.g. Staff Number, Name etc.
One Column, say Column G, contains a Key No followed by several further
Columns each with a Unique Code e.g. 1400, 1410, 1430. Under one these
Columns there will be a value.

Column A Column B Column G Column H Column I Column K etc
etc
Number Name Key 1400 1410
1430
30000 West 30000ABC 1
30000 West 30000ABC 2
30000 West 30000 1
30000 West 30000ABC
5
30000 West 30000XYZ 6
30000 West 30000 2
30010 North 30010 1
30010 North 30010 1

What I want to happen is for the macro to merge like Keys and total the
values within the respective columns so the end result looks like this

Column A Column B Column G Column H Column I Column K
Number Name Key 1400 1410
1430
30000 West 30000 1 2
30000 West 30000ABC 3
5
30000 West 30000XYZ 6
30010 North 30010 1 1


Can anyone help?


--
MrGPeter


------------------------------------------------------------------------
MrGPeter's Profile: http://www.excelforum.com/member.php...o&userid=27254
View this thread: http://www.excelforum.com/showthread...hreadid=467661

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Macro to Merge and Sum Rows

I would recommend to avoid the code and look at pivot tables... They will do
everything you want and a whole pile more...
--
HTH...

Jim Thomlinson


"MrGPeter" wrote:


Hi, I'm a relative newbie to Macros and this is my first posting

I have created a macro which extracts data from other spreadsheets into
one master spreadsheet but I need help to then automatically tidy up the
results

The spreadsheet contains several columns over several hundred rows. The
first few columns of each row contain data e.g. Staff Number, Name etc.
One Column, say Column G, contains a Key No followed by several further
Columns each with a Unique Code e.g. 1400, 1410, 1430. Under one these
Columns there will be a value.

Column A Column B Column G Column H Column I Column K etc
etc
Number Name Key 1400 1410
1430
30000 West 30000ABC 1
30000 West 30000ABC 2
30000 West 30000 1
30000 West 30000ABC
5
30000 West 30000XYZ 6
30000 West 30000 2
30010 North 30010 1
30010 North 30010 1

What I want to happen is for the macro to merge like Keys and total the
values within the respective columns so the end result looks like this

Column A Column B Column G Column H Column I Column K
Number Name Key 1400 1410
1430
30000 West 30000 1 2
30000 West 30000ABC 3
5
30000 West 30000XYZ 6
30010 North 30010 1 1


Can anyone help?


--
MrGPeter


------------------------------------------------------------------------
MrGPeter's Profile: http://www.excelforum.com/member.php...o&userid=27254
View this thread: http://www.excelforum.com/showthread...hreadid=467661


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Merge and Sum Rows


Thanks for the help Jim.

I tested a couple of Pivot Tables to get the desired result. Once ther
I created a macro which allows the Pivot Table to be create
automatically, removes the Sub Total fuction on the fields and thi
leaves me with exactly what I need. Brill :

--
MrGPete

-----------------------------------------------------------------------
MrGPeter's Profile: http://www.excelforum.com/member.php...fo&userid=2725
View this thread: http://www.excelforum.com/showthread.php?threadid=46766

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
Macro to merge 3 rows multi times, columns A:K only Steve Excel Worksheet Functions 0 November 19th 09 05:37 PM
merge two rows CandiC Excel Discussion (Misc queries) 5 April 21st 09 02:18 PM
Merge two rows into one, then merge into mailer? tavat Excel Worksheet Functions 0 May 24th 06 07:52 PM
How to merge rows? kiever1 Excel Discussion (Misc queries) 3 March 17th 06 02:03 PM
I would like to merge two rows hassan barjini New Users to Excel 1 December 13th 05 11:40 AM


All times are GMT +1. The time now is 12:50 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"