Other than some very early and limited exposure to original Basic, my first exposure to programming was with Macro sheets in Microsoft Excel.

Without seeming to brag, I must admit that wrote some pretty amazing code with Excel Macros, and continued to use it LONG after VBA was introduced.
My reluctance to abandon Macros is at least partially responsible for my now lagging in actual VB experience but i am learning.

One thing I was able to do in Macros that blew the minds of many other supposed Excel Experts was to use code, to build more code that would run within the currently running operations. This was VERY useful when, for one example, I was reading and evaluating data that contained litterally millions of possible combinations that could not easily be ascertained in advance.

By defining certain cells with named references, and then using the currently operating code to concatenate text strings, and then convert the text to readable values with the text to columns function, I could actually build code, name defined references, designate columns and many more things, without knowing in advance what would be found, all within one operating set of code and do it while it was running, and by itself.

So far, within VBA and or VB, I've not been able to figure this cabability out.
Much of what I'm doing now would seem much easier, and faster if rather than knowing in advance exactly what I'm processing, I could let the application read ahead and build its own code based on what it finds.

Is there any functionality that allows one to build code within a module, either currently running, or an external one that can be referenced by a preexisting function in the running module?

For example, lets say I have a 100,000 text strings and I want to find and define all words contained in those strings.
I do not know in aadvance what words will exist.
I do not know in advance how many words are in each string.
I do not know how many characters will be used.
I only know the strings potential maximum length.

At this point, I have to define a "guess" at the maximum number of words and define a variable for each numbered guess, lets say word_1 through word_25.
Now I have learned AFTER THE FACT that none of the stings has contained more than 15 words, but that is not a rule and could easily be exceeded.
Rather than taking a guess and limiting myself to the 25 maximum words, I'd much rather let the code read, and create variables as it determined the need and then define them.

I have worked with the "gusssing" method described above. I create a table and append to it from a cross tab of the unique strings, and then read each unique string and send them back to the database as one record with specific "Word_nn" columns, then sent each column to a single column in a different table and then cross tab that table to get the unique word references, but the chance exists that one of the strings could contain more words than my guess. This works, but after about 5000 records in a table it starts to slow drastically, and I have to stop it, dump the data into a storage table, delete the processed records and start over.

I could read each line, one at a time, and identify each single word using any of several delimiters, and then check the database to see if that word is already logged, but that seems slow considering that at an average of 10 words per string that creates about a MILLION steps of that single process.

What would seem MUCH better, if if I could let the application read to a certain limit, CREATE and define variables as needed, to a certain limit, and then send that to the database, and then start over until all were processed.

Am I WAY OFF BASE?
Is such a thing possible (to use code to build more code)?

thanks as always!!!