epactheactor
New Member
- Joined
- Sep 9, 2015
- Messages
- 38
Hello!
I'm working on a code and have come upon something that I hope has an easy way to do.
In it, there are 3 cells in the workbook. Each cell can only have 1 of 3 possible string values in it. For this example say A, B or C. Depending on the combination of letter, they receive a different score.
Is there a way to write out a code without having to write out every possible combination? I would think maybe a select case, but I would still have to write out every possible combination, correct?
For example in puedocode,
If ((Cell1 = "A" Cell2 = "B" Cell3 = "C") or (Cell1 = "B" Cell2 = "A" Cell3 = "C") or (Cell1 = "C" Cell2 = "B" Cell3 = "A") (and so on) )
score = 100
Elseif (Cell1 = "A" Cell2 = "A" Cell3 = "C") or (Cell1 = "A" Cell2 = "C" Cell3 = "C")
score = 50
ElseIf (Cell1 = "B" Cell2 = "B" Cell3 = "C"
score = 60.
(And so on)
Thank you for any help.
I'm working on a code and have come upon something that I hope has an easy way to do.
In it, there are 3 cells in the workbook. Each cell can only have 1 of 3 possible string values in it. For this example say A, B or C. Depending on the combination of letter, they receive a different score.
Is there a way to write out a code without having to write out every possible combination? I would think maybe a select case, but I would still have to write out every possible combination, correct?
For example in puedocode,
If ((Cell1 = "A" Cell2 = "B" Cell3 = "C") or (Cell1 = "B" Cell2 = "A" Cell3 = "C") or (Cell1 = "C" Cell2 = "B" Cell3 = "A") (and so on) )
score = 100
Elseif (Cell1 = "A" Cell2 = "A" Cell3 = "C") or (Cell1 = "A" Cell2 = "C" Cell3 = "C")
score = 50
ElseIf (Cell1 = "B" Cell2 = "B" Cell3 = "C"
score = 60.
(And so on)
Thank you for any help.