Partially merge two rows, then delete second
Posted: Tue Sep 01, 2009 1:40 am
Hi all
I am back again with my timetable
I dont know if there is macro that can do such a complicated task
In bref: I need to compare two rows, if a condition is meet, concatenate/add some cells from second row to the first row , delete the second row, edit a cell in first row, then look for next
these is simplified data from the timetable posted here: http://user.services.openoffice.org/en/ ... 52&t=21890
Column C contains student groups like: TS1, TS2... TL1, TL2, 2S1...
Column C contain Subgroups named like this:
TS1-1, TS1-2 those are sbgroups for group TS1
TS2-1 and TS2-2 are subgroups for group TS2
1S1-1 and 1S1-2 are subgroups for group 1S1
and so on..... (there are many groups and subgroups, with same naming scheme,
and for a given group G, there is only two possible subgroups: G-1 and G-2)
I need to merge each two rows containing data for the two subgroups
like this:
suppose a first occurence of first subgroup is in row 3 (like in screenshoot)
check for the next row containing data about second subgroup, its name is ending in "-2"
add content from cell E12 to cell E3
add content from cell F12 to cell F3
delete row 12
rename C3's content from "TS1-1" to "TS1" (strip subgroup reference)
then loop
ouuf !! hope I explained my problem very well !!
Basically, I want output to be similar to that:
I am back again with my timetable
I dont know if there is macro that can do such a complicated task
In bref: I need to compare two rows, if a condition is meet, concatenate/add some cells from second row to the first row , delete the second row, edit a cell in first row, then look for next
these is simplified data from the timetable posted here: http://user.services.openoffice.org/en/ ... 52&t=21890
Column C contains student groups like: TS1, TS2... TL1, TL2, 2S1...
Column C contain Subgroups named like this:
TS1-1, TS1-2 those are sbgroups for group TS1
TS2-1 and TS2-2 are subgroups for group TS2
1S1-1 and 1S1-2 are subgroups for group 1S1
and so on..... (there are many groups and subgroups, with same naming scheme,
and for a given group G, there is only two possible subgroups: G-1 and G-2)
I need to merge each two rows containing data for the two subgroups
like this:
suppose a first occurence of first subgroup is in row 3 (like in screenshoot)
check for the next row containing data about second subgroup, its name is ending in "-2"
add content from cell E12 to cell E3
add content from cell F12 to cell F3
delete row 12
rename C3's content from "TS1-1" to "TS1" (strip subgroup reference)
then loop
ouuf !! hope I explained my problem very well !!
Basically, I want output to be similar to that: