biostatistician
New Member
- Joined
- Oct 24, 2014
- Messages
- 11
Hi all,
New this forum. I'm not a VB expert but did some work with VB years ago back in graduate school so I'm not too familiar anymore.
I'm basically trying to take Column G, and transpose it accordingly. For example, STUDY #2 has 3 extra rows in Column G which I want to transpose to ROW K and onward.
I want to do the same for Study 3 and 4 and so on for almost 3000 STUDY #'s. But the number of rows vary. Is there a code to do this? I know it will be conditional and I need the code to realize it's finished transposing for that STUDY # once the next STUDY appears. I've posted an example of what I'm looking for below. Any help with this would be greatly appreciated!
WHAT I HAVE:
A B C D E F G H I J K L
<tbody>
</tbody>
New this forum. I'm not a VB expert but did some work with VB years ago back in graduate school so I'm not too familiar anymore.
I'm basically trying to take Column G, and transpose it accordingly. For example, STUDY #2 has 3 extra rows in Column G which I want to transpose to ROW K and onward.
I want to do the same for Study 3 and 4 and so on for almost 3000 STUDY #'s. But the number of rows vary. Is there a code to do this? I know it will be conditional and I need the code to realize it's finished transposing for that STUDY # once the next STUDY appears. I've posted an example of what I'm looking for below. Any help with this would be greatly appreciated!
WHAT I HAVE:
A B C D E F G H I J K L
STUDY | Present | Gen | Number | race | short | diag | Ad | Di | Re | ||||||||||
1 | Y | F | 30 | O | 81200 | 81201 | M | M | ** | ||||||||||
2 | Y | M | 20 | J | 83410 | 83412 | O | O | ** | ||||||||||
30501 | |||||||||||||||||||
E8888 | |||||||||||||||||||
E8498 | |||||||||||||||||||
3 | Y | M | 40 | B | 80230 | 80235 | S | S | Y | ||||||||||
E9688 | |||||||||||||||||||
E8495 | |||||||||||||||||||
4 | Y | M | 50 | B | 81510 | 81514 | S | S | ** | ||||||||||
8832 | |||||||||||||||||||
E9174 | |||||||||||||||||||
E8498 | |||||||||||||||||||
71894 | |||||||||||||||||||
9556 | |||||||||||||||||||
5 | N | F | 25 | M | 82382 | 82302 | S | O | Y | ||||||||||
8082 | |||||||||||||||||||
8056 | |||||||||||||||||||
2851 | |||||||||||||||||||
81201 | |||||||||||||||||||
920 | |||||||||||||||||||
85011 | |||||||||||||||||||
E8147 | |||||||||||||||||||
E8495 | |||||||||||||||||||
4019 | |||||||||||||||||||
2724 | |||||||||||||||||||
WHAT I NEED: | |||||||||||||||||||
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T |
STUDY | Present | Gen | Number | race | short | diag | Ad | Di | Re | ||||||||||
1 | Y | F | 30 | O | 81200 | 81201 | M | M | ** | ||||||||||
2 | Y | M | 20 | J | 83410 | 83412 | O | O | ** | 30501 | E8888 | E8498 | |||||||
3 | Y | M | 40 | B | 80230 | 80235 | S | S | Y | E9688 | E8495 | ||||||||
4 | Y | M | 50 | B | 81510 | 81514 | S | S | ** | 8832 | E9174 | E8498 | 71894 | 9556 | |||||
5 | N | F | 25 | M | 82382 | 82302 | S | O | Y | 8082 | 8056 | 2851 | 81201 | 920 | 85011 | E8147 | E8495 | 4019 | 2724 |
<tbody>
</tbody>