Excelboy_01
New Member
- Joined
- Aug 5, 2011
- Messages
- 32
Hello People,
I would really appreciate it if any one would help me with a code that can used to mergecells.
Basically, assume I have a sheet as indicated below. I want if I enter say a 13 (week number
for year 2011) in cell V2, I would like to Merge all cells (in column 1) until it reaches cell I1
where literaly the year starts(.i.e. by noticing 1 in cell I2). Then merge the other cells
for year 2010, until cell A1 (since there no more entry beyond 47 i.e. Cell A2)
/| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S |T | U | V |
-+---+---+---+----+---+---+---+---+---+---+---+---+----+----+---+---+---+----+---+---+- 1|...............2010...........................|........................2011.............................| -+---+---+---+----+---+---+---+---+---+----+---+---+---+----+---+----+---+----+----+----+---+
2|47 |48 | 49| 50 | 51| 52|52 |53 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|11 | 12 | 13| -+---+---+---+----+---+---+---+---+---+----+---+---+---+----+---+----+---+----+----+----+---+
PS: I need auto merge because the weeks constantly change. At one point I can insert week 30 in
cell V2, so it would emerge all cells till arrives to 1 in column 2.
Thanks a lot for your help
Moses
I would really appreciate it if any one would help me with a code that can used to mergecells.
Basically, assume I have a sheet as indicated below. I want if I enter say a 13 (week number
for year 2011) in cell V2, I would like to Merge all cells (in column 1) until it reaches cell I1
where literaly the year starts(.i.e. by noticing 1 in cell I2). Then merge the other cells
for year 2010, until cell A1 (since there no more entry beyond 47 i.e. Cell A2)
/| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S |T | U | V |
-+---+---+---+----+---+---+---+---+---+---+---+---+----+----+---+---+---+----+---+---+- 1|...............2010...........................|........................2011.............................| -+---+---+---+----+---+---+---+---+---+----+---+---+---+----+---+----+---+----+----+----+---+
2|47 |48 | 49| 50 | 51| 52|52 |53 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|11 | 12 | 13| -+---+---+---+----+---+---+---+---+---+----+---+---+---+----+---+----+---+----+----+----+---+
PS: I need auto merge because the weeks constantly change. At one point I can insert week 30 in
cell V2, so it would emerge all cells till arrives to 1 in column 2.
Thanks a lot for your help
Moses