You major task would be to replace all the Excel specific calls such as
Range(). If my understanding of Excel is still working these are used to
read values from sheets into variables and to write back the results.
Probably you need to open several recordsets to do this is Access VBA. But
first you need to design the underlying tables to store the data. It is
very importent here that you nail down in your understanding (if you haven't
already) the difference between locating data by its position in sheets and
by referring to table names, key values and field names. In the latter the
concept of data being "N-dimensional" is not very useful.
There are also some 'magic numbers' in the code such as 22; 24,5000; 50,000
that you need to understand. Probably these ought to be parameterised in
the function call or made into references to controls on a form depending on
what they do. Controlling your code through embedded unnamed constants is
*very* inflexible not to mention obscure.
The logically constructions such as For..Next, If ..Then...Else will
translate. I notice some Gotos which might be tidied up using Do... While,
Do...Until, Exit this or that. While tidying up some error management and
comments could be added so the next bloke working on the thing isn't in the
same situation. As it stands it is hard to follow the code and if it is
going to take three weeks to get a result you will have to apply the Vulcan
Nerve Pinch to stop it.
As for the efficiency or suitability of the algorithm I have no idea.
David