# Thread: VBA Mac coding Question

1. ## VBA Mac coding Question

Trying to write code to show prime numbers 3-1000, then show the sum of the digits of each of those prime numbers, and ultimately just show the prime numbers whose sum is prime. Example the number is 11 to show 1+1=2, 2 would also be shown because it is also a prime number. I have the code working for prime numbers, however cannot get it to sum the digits or show the summed primes. Please help!  Reply With Quote

2. Have you tried this?
=SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))  Reply With Quote

3. I see this was posted a few months ago. Are you still working on the problem? If so, you mention the sum of digits of 11 is 2 and 2 is prime. Are you summing all the digits of all the primes or only the sum of the digits that result in a prime sum? Are you doing this all in VBA or are you displaying all primes <1000 on a spreadsheet?  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•