gjones said:
thank you very much now how do i apply this VBA MACRO?
I hope you realize that I am __not__ recommending this macro. I had hoped
that you would abandon your foolish quest after seeing the macro and
contemplating the discouraging responses about the number of computations.
Be that as it may....
1. Use Tools > Macros > Security Level to set Medium level. This will
permit you to reopen the workbook with a prompt to enable macros.
Note: Macro security will apply to all workbooks that you open
subsequently.
2. Use Excel Help to find "Create macro", then click on "Create macro using
Microsoft Visual Basic" for general instructions.
3. Select and copy the macro text (including the Option Explicit directive),
and paste into the VBE window.
Note: The line "cells(r,c) = ...." probably will not paste as intended
due to wrap-around in the posting. If that line becomes two or more lines
when you paste into the VBE window, add " _" (space underscore) at the end
of each __except__ the last line.
Also: See the suggestion below before you execute the macro.
4. In Excel, select or insert a blank worksheet. With that as the active
worksheet....
5. In the VBE window, put the cursor anywhere between the Sub and End Sub
statements, then press F5 to execute the macro.
Be forewarned that the macro as written, generating more than 1.7 million
permutations in 65536 rows of 256 columns, will probably run for several
minutes, at least -- maybe even __many__ minutes the first time. (On my
computer, I estimated about 18 minutes for the first time, but less than 4
minutes for subsequent times.)
Suggestion....
Before you invest many minutes of compute time, I suggest that you try a
scaled-down run to see if the macro is giving you results in a form that you
want. For example:
Const rMax As Long = 10 'instead of 65536
Const cMax As Long = 10 'instead of 256
will generate 100 permutations in a 10-by-10 range in the worksheet.
----- original message -----