PDA

View Full Version : Help with coding for labels



Mikroicy
10-13-2017, 12:04 AM
I need a bit of help with writing a code in excel.

I have a spreadsheet like the one below. What I would like to do is to copy the data from 4 cells into 1 cell with spaces in-between onto a new list (list 2) so that it would be populated as such:

A6: 1 P1 1 1 (or as transcribed from list 1: A3 B3 A4 B4)
A7: 1 P1 2 2 (or as transcribed from list 1: A6 B6 A7 B7)
A8: 2 P1 1 3 (or as transcribed from list 1: C3 D3 C4 D4)
A9: 2 P1 2 4 (or as transcribed from list 1: C6 D6 C7 D7)
A10: 3 P1 1 5 (or as transcribed from list 1: E3 F3 E4 F4)
A11: 3P1 2 6 (or as transcribed from list 1: E6 F6 E7 F7)
A12: 1 P2 1 7 (or as transcribed from list 1: A9 B9 A10 B10)
A13: 1 P2 2 8

and so on,.... the thing is that the table can be much bigger depending on the numbers populated in A4, A7, A10,... (everytime 3 rows lower) and these numbers repeat based on the number of periods (P1, P2, P3,....), and the number of columns depend on the number of subjects in A3, C3, E3, G3, ... (everytime 2 cells to the right). the numbers that are the most important are bolded. They scale from subject 1 in Period 1 (P1) to the last subject in P1 and then continue scaling from subject 1 in Period 2 to the last subject in Period 2 and so on in Period 3 and Period 4,.... so what I would need is a macro button to click and the data from this table would be trasfered onto a new list as described above.



A

B

C

D

E

F



1









2









3

1

P1

2

P1

3

P1



4

1

1

1

3

1

5



5









6

1

P1

2

P1

3

P1



7

2

2

2

4

2

6



8









9

1

P2

2

P2

3

P2



10

1

7

1

9

1

11



11









12

1

P2

2

P2

3

P2



13

2

8

2

10

2

12

mancubus
10-13-2017, 02:16 PM
can you post your workbook?