Hi guys,
Can a genius help me transpose the below validation into a macro, pretty please?
Can a genius help me transpose the below validation into a macro, pretty please?
The check digit for an EAN-13 code is calculated as follows:
- Count digit positions from the left to the right, starting at 1.
- Sum all the digits in odd positions. (As example, for EAN code 9780521425575, this is 9 + 8 + 5 + 1 + 2 + 5 = 30 â note that the final 5 is not included since this is the check digit, which is what we are currently trying to calculate.)
- Sum all the digits in even positions and multiply the result by 3. (In the example, this is (7 + 0 + 2 + 4 + 5 + 7) Ă 3 = 75.)
- Add the results of step 2 and step 3, and take just the final digit (the âunitsâ digit) of the answer. This is equivalent to taking the answer modulo-10. (In the example, the sum is 30 + 75 = 105, so the units digit is 5.)
- If the answer to step 4 was 0, this is the check digit. Otherwise the check digit is given by ten minus the answer from step 4. (In the example, this is 10 â 5 = 5.)
- The check digit is appended to the right of the 12 identification digits. The check digit can have any value from 0 to 9.
Alternatively, there is a shortcut to checking for errors because of the way the check digit is derived. You take the full 13-digit received code and do steps 1 to 4 from the calculation used above. If the code is correct, the value at step 4 will be 0. If the code is wrong, it will have some other value.
Exploring communications technology
This free course, Exploring communications technology, looks at some of the principles underpinning communications technology. It looks at the properties of signals and media (such as optical fibre...www.open.edu