Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Angol
 
Posts: n/a
Default Second appeal for help

I need to perform an operation on several long series of data. It 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?

PS. This repeats an earlier appeal for help that sadly went unanswered.
The operation I'm performing is
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("F2:F251"),
ActiveSheet.Range("C2:C251"), False, False, ,
ActiveSheet.Range("AM21"), False, False, False, False, , False.

  #2   Report Post  
dominicb
 
Posts: n/a
Default


Good evening Angol

Can you select the range(s) that need to be worked on? If so, use a
for next loop thus:

For Each Rnge in Selection

' Your code goes here, but replace the cell address with Rnge

Next Rnge

When the range(s) is / are selected, this code will perform any given
operation on each selected cell in turn.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=386928

  #3   Report Post  
Angol
 
Posts: n/a
Default

Many thanks DominicB for your help. I've just got back to the problem
and have been reading up on For-Next Loops. Despite much experimenting
I've still not managed to write what I need.
I need the macro to execute Application.Run "ATPVBAEN.XLA!Regress",
ActiveSheet.Range("F2:F251"), ActiveSheet.Range("C2:C251"), False,
False, , ActiveSheet.Range("AM21"), False, False, False, False, ,
False.
and then do the same thing on Ranges F3:F252, C3:C252 and AM41 and so
on, i.e. to pick data from ranges each of which is one line below its
predecessor and to print the results to cells 20 lines apart. (What
happens after that to tidy up the results, produce graphs, etc., works
fine)
I need to do this about a thousand times on each set of data.
While I can see the general idea For-Next-Step 1 and For-Next-Step 20,
writing what's needed is beyond me.
Can DominicB or anyone else help?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"