Hello,
Here is another question (i seem to have so many )
Say i have this in excel:
List 1
Cell A1 = a
Cell A2 = b
Cell A3 = c
List 2
Cell B1 = 1
Cell B2 = 2
Cell B3 = 3
And then have excel, say on a commandbutton_click, run through a code, using all possibilities made by mixing the two columns together for logical tests:
So I'd like something along these lines to happen.
The generic code being:
If whatever_1stCell = varFromList1 AND whatever_2ndCell = varFromList2 then
call Do_Something
End If
And basically put that generic code into some sort of loop, so that each time it runs, the varFromList1 and the varFromList2 will change eventually represent all possibilities of the two lists. i.e. I'd like this to happen:
First loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 1 then
call Do_Something
End If
Second loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 2 then
call Do_Something
End If
Third loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 3 then
call Do_Something
End If
Fourth loop, the code will be:
If whatever_1stCell = b AND whatever_2ndCell = 1 then
call Do_Something
End If
Fifth loop, the code will be:
If whatever_1stCell = b AND whatever_2ndCell = 2 then
call Do_Something
End If
. . . And so on, untill the last run through the loop, where the code should be:
If whatever_1stCell = c AND whatever_2ndCell = 3 then
call Do_Something
End If
So you can see i'm trying to have it so that two variable will test all possibilities of the two lists mixed together.
i.e.
a and 1
a and 2
a and 3
b and 1
b and 2
b and 3
c and 1
c and 2
c and 3
How could i go about doing this???
Any help would be greatly appreciated
Hope that all made sense
Thankyou for your time,
Cheers
kJ
Here is another question (i seem to have so many )
Say i have this in excel:
List 1
Cell A1 = a
Cell A2 = b
Cell A3 = c
List 2
Cell B1 = 1
Cell B2 = 2
Cell B3 = 3
And then have excel, say on a commandbutton_click, run through a code, using all possibilities made by mixing the two columns together for logical tests:
So I'd like something along these lines to happen.
The generic code being:
If whatever_1stCell = varFromList1 AND whatever_2ndCell = varFromList2 then
call Do_Something
End If
And basically put that generic code into some sort of loop, so that each time it runs, the varFromList1 and the varFromList2 will change eventually represent all possibilities of the two lists. i.e. I'd like this to happen:
First loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 1 then
call Do_Something
End If
Second loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 2 then
call Do_Something
End If
Third loop, the code will be:
If whatever_1stCell = a AND whatever_2ndCell = 3 then
call Do_Something
End If
Fourth loop, the code will be:
If whatever_1stCell = b AND whatever_2ndCell = 1 then
call Do_Something
End If
Fifth loop, the code will be:
If whatever_1stCell = b AND whatever_2ndCell = 2 then
call Do_Something
End If
. . . And so on, untill the last run through the loop, where the code should be:
If whatever_1stCell = c AND whatever_2ndCell = 3 then
call Do_Something
End If
So you can see i'm trying to have it so that two variable will test all possibilities of the two lists mixed together.
i.e.
a and 1
a and 2
a and 3
b and 1
b and 2
b and 3
c and 1
c and 2
c and 3
How could i go about doing this???
Any help would be greatly appreciated
Hope that all made sense
Thankyou for your time,
Cheers
kJ