Hey Everyone,
I'm having difficulty with writing nested for loops in VBA. Could someone help me out just a little by giving me the equivalent of the following algorithm?
for(i=1;i<200;i++)
{
for(j=1;j<1063;j++)
{
for(k=1;k<1063;k++)
{
if(table1(i,j)&&table1(i,k)!=0)
{
table2(i,j)=table2(i,j)+table1(i,k);
}
}
}
}
Essentially table 1 is a table with names in the A column and products they own correspondingly.
table 2, which i want to get, is a product vs product table that will tell me how many companies from table1 own both products x&y
Any chance you could help me out? I'd be very grateful!
I'm having difficulty with writing nested for loops in VBA. Could someone help me out just a little by giving me the equivalent of the following algorithm?
for(i=1;i<200;i++)
{
for(j=1;j<1063;j++)
{
for(k=1;k<1063;k++)
{
if(table1(i,j)&&table1(i,k)!=0)
{
table2(i,j)=table2(i,j)+table1(i,k);
}
}
}
}
Essentially table 1 is a table with names in the A column and products they own correspondingly.
table 2, which i want to get, is a product vs product table that will tell me how many companies from table1 own both products x&y
Any chance you could help me out? I'd be very grateful!