PDA

View Full Version : For Each digit in a multi-digit number



kualjo
07-23-2015, 10:53 AM
This is probably not as hard as it seems, but I keep getting a run-time error 13 (type mismatch), and it's got me stumped. The code begins by asking for a number, then adds each digit until it gets down to a single digit. (This is just a simple learning exercise.) I enter a number, values are assigned to some variables, and then it bombs at this line:


For Each i In num

where "num" is the number entered.

What's wrong with this and how can I get it to work?