Hi,
I am looking for a script to decompose a list of numbers into their prime factors.
Attached is a file with an example of what I am looking for.
Thanks for your help,
Philippe
Hi,
I am looking for a script to decompose a list of numbers into their prime factors.
Attached is a file with an example of what I am looking for.
Thanks for your help,
Philippe
Google search on "decomposition in prime factors +excel" yielded more than 100 k answers -
E.g.,![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Last edited by shg; 07-03-2011 at 07:29 PM.
Entia non sunt multiplicanda sine necessitate
Hi,
I tried this code but got this error message: Argument not optional
Any idea of what is wrong?
Philippe
"Tried it" in what way?
I created a module with the code.
Then pressed alt f8 and made the Factors function run.
This is when I received the error message.
You used a formula on a worksheet, or wrote code to test it? If the latter, post the code.
Hi,
I could figure out what what went wrong.
I wasn't applying the function properly in the cells.
Thank you for your patience, sorry I am kind of an absolute beginner in Excel.
Philippe
Well done, glad you got it sorted out.
I clicked select code copied the code then opened a new module in the vb editor and pasted the code in. then selected "close and return to excel" on the file menu. I selected a column of values and pressed Alt+F8 to view macros the macro doesn't appear on the list. So I looked at the code, didn't find "sub Marco_name()" or "end sub" so I deleted that module created a new one and typed "sub prime_factors()" and Enter. Then I pasted the code in between exited to excel and tried to run the macro by selecting a range of values typing "Alt+F8" and got the error "expecting endsub" what am I doing wrong please
Captain Pedro,
Welcome to the Forum, unfortunately:
Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks