Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concatenate columns, variable number of rows
Do you import the report to excel or did you create the report in
excel? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
concatenate formula for rows with differing amount of columns | Excel Discussion (Misc queries) | |||
Concatenate info from columns into rows | Excel Discussion (Misc queries) | |||
Concatenate multiple rows and columns into 1 cell | Excel Discussion (Misc queries) | |||
Select Variable Number of Columns | Excel Programming | |||
HIDING A VARIABLE NUMBER OF COLUMNS | Excel Programming |