Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Concatenate columns, variable number of rows

I have a report that returns multiple rows per ID number. The columns always
stay the same. The number of rows per ID number is variable. I would like
to group the info per ID number into one cell. If the number of rows was
constant I could concatenate easily. But each ID number could have one row
or a hundred rows, it is completely variable. Can VBA be used to
concatenate?

The way the report currently looks, it gives the ID number in the first row,
then each subsequent row has the ID number blank until there is a new ID
number to show. This report comes out of a database.

Sample data:

ID Country Number
1234-5678 US 123456
[blank] GB 789123
[blank] IT 456789
4567-8912 US 23456
8912-3456 EP 1234567
[blank] US 8912345
[blank] JP 456789
[blank] CN 123456789
2345-6789 [blank]

So in this example what I want to end up with is two columns, on row per ID
number:

ID Related Matters (one cell)
1234-5678 US 123456; GB 789123; IT 456789
4567-8912 US 23456
8912-3456 EP 1234567; US 8912345; JP 456789; CN 123456789
2345-6789 [blank]

Thanks in advance for any help/ideas anyone can give!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default Concatenate columns, variable number of rows

Do you import the report to excel or did you create the report in
excel?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Concatenate columns, variable number of rows

The report is coming from a database, going into excel format. I'm saving
into .csv. If I save into .xls it creates it so the the ID number cell spans
the multiple rows, instead of returning blank rows, if that makes any
difference.

I didn't create the report, however, it's just one I use. I'm not sure I
can get it to alter in format at all. Perhaps could get it altered to fill
in the blank ID numbers, but I'm not sure (just guessing that's what you're
wondering about)

"dan dungan" wrote:

Do you import the report to excel or did you create the report in
excel?

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
concatenate formula for rows with differing amount of columns tommykraz Excel Discussion (Misc queries) 3 June 18th 08 11:21 PM
Concatenate info from columns into rows jbjtc Excel Discussion (Misc queries) 2 December 7th 07 02:57 PM
Concatenate multiple rows and columns into 1 cell mj44 Excel Discussion (Misc queries) 21 July 19th 07 09:18 AM
Select Variable Number of Columns Mike H. Excel Programming 4 July 9th 07 05:46 AM
HIDING A VARIABLE NUMBER OF COLUMNS [email protected] Excel Programming 1 February 15th 07 09:14 PM


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