ThomasSchmidt
New Member
- Joined
- Mar 3, 2021
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Dear all,
i'm new to this forum, please excuse if i haven't figured out all the necessary details how to post a proper question including tables etc...
I am looking for a way in VBA to get a tabe populated with all conceivable permutations of a binary variable (think of an indicator or something like that). My starting tables look more or less like this:
T____P_1:_____P_2:_____P_3:_____P_4:_____P_5:_____P_6:_____P_7:_____P_8:
1
2
3
...
...
Say my vector-length is t (here T=3), then i have 2^3 =8 vectors containing all possible combinations. What i'm looking for is an algorithm that produces something like this below:
T____P_1:_____P_2:_____P_3:_____P_4:_____P_5:_____P_6:_____P_7:_____P_8:
1____|1|_______|1|_______|1|_______|1|_______|0|_______|0|_______|0|_______|0|
2____|1|_______|0|_______|1|_______|0|_______|1|_______|0|_______|1|_______|0|
3____|1|_______|1|_______|0|_______|0|_______|1|_______|1|_______|0|_______|0|
Needless to say that i have 1200 tables with various T (each table has a specific T-length) but across those tabes T can vary (thus a nested For..loop doesn't work for me i'm afraid) for which i have to perform this on a daily basis, so yes: VBA is obviously the way to do it. I have a working knowledge of VBA (basics) but somehow i'm too blind to see the obvious logic how to populate those tables...
Thank you so much for any help or tips!!
Thomas
i'm new to this forum, please excuse if i haven't figured out all the necessary details how to post a proper question including tables etc...
I am looking for a way in VBA to get a tabe populated with all conceivable permutations of a binary variable (think of an indicator or something like that). My starting tables look more or less like this:
T____P_1:_____P_2:_____P_3:_____P_4:_____P_5:_____P_6:_____P_7:_____P_8:
1
2
3
...
...
Say my vector-length is t (here T=3), then i have 2^3 =8 vectors containing all possible combinations. What i'm looking for is an algorithm that produces something like this below:
T____P_1:_____P_2:_____P_3:_____P_4:_____P_5:_____P_6:_____P_7:_____P_8:
1____|1|_______|1|_______|1|_______|1|_______|0|_______|0|_______|0|_______|0|
2____|1|_______|0|_______|1|_______|0|_______|1|_______|0|_______|1|_______|0|
3____|1|_______|1|_______|0|_______|0|_______|1|_______|1|_______|0|_______|0|
Needless to say that i have 1200 tables with various T (each table has a specific T-length) but across those tabes T can vary (thus a nested For..loop doesn't work for me i'm afraid) for which i have to perform this on a daily basis, so yes: VBA is obviously the way to do it. I have a working knowledge of VBA (basics) but somehow i'm too blind to see the obvious logic how to populate those tables...
Thank you so much for any help or tips!!
Thomas