can anyone help with repeating the same action on different ranges?

A

Angol

I need to perform an operation on several long series of data:

Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("F2:F251"),
ActiveSheet.Range("C2:C251"), False, False, ,
ActiveSheet.Range("AM21"), False, False, False, False, , False.

This works fine on an single data set.

And I'm able to generate the thousand or so sets of addresses -
F3:F252,C3:C252,AM41, etc. that I need. Unsurprisingly, though,
VBA/Excel protests that if I copy a thousand lines like that into a
macro I get a procedure that is is too large.

The elegant way to do what I want is to instruct Excel to perform the
regression, and then move one line down in a lookup table to change the
references and then run it again.

Long ago I recorded macros in Lotus123 that would pick up an
instruction to go, e.g. 1 line down and repeat something we'd done
before and I vaguely understand what the structure of what I need would
look like.

Can anyone advise me as to what I should be doing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top