Consulting

Results 1 to 2 of 2

Thread: VBA Mac coding Question

  1. #1
    VBAX Newbie
    Joined
    Feb 2021
    Posts
    1
    Location

    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!

  2. #2
    Moderator VBAX Guru Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    3,880
    Location
    Have you tried this?
    =SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))
    Remember To Do the Following....
    Use tags when posting code to the thread,
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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