View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Write to Module While Macro is Running

You can visit Chip Pearson's site to see how to write code that writes code:
http://www.cpearson.com/excel/vbe.aspx

But I wouldn't do it. I like your "save to a worksheet" much, much better.

(Hide that sheet if haven't already!)

ron wrote:

I have a macro that allows the user to study vocabulary words. At the
outset the array is filled with integers, one for each word. A number
is randomly selected from the array and the word corresponding to that
number is examined. That number is then removed from the array. Only
after all words have been examined is the array is repopulated with
all of the numbers. This allows to the user to examine all words
before a specific word is encountered again. On exiting the workbook,
whatever numbers remain in the array are written to a worksheet, so
that the array can be filled with only these remaining numbers the
next time the user opens the workbook. This way the user can resume
where he or she left off last time.

My question, rather than writing the current array to a worksheet, is
there a way to write the actual array components (remaining integers)
to the module? Everything works fine as is, I'm just wondering if
this can be done and eliminate the need for the worksheet to store the
array components on exit...TIA, Ron


--

Dave Peterson