Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, Others today have already kindly helped with my queries today, for
which Im grateful. I though Id post this to see if it helps with the questions I m asking. Below is my attempt, xsum are normal variables and runner are static. I was looking at this and seeing if I could use a for/next with it, as I wish to add many more runners, and with prev help Ive used Dim xsum(1 to 4) which is ok, but Im struggling with the static variables. For y = UBound(Runner1) - 20 To UBound(Runner1) x20sum1 = x20sum1 + Runner1(y) x20sum2 = x20sum2 + Runner2(y) x20sum3 = x20sum3 + Runner3(y) x20sum4 = x20sum4 + Runner4(y) Next y This is what Ive attempted but doesnt work. I though diefine the runners individually. For i = 1 to 4 For y = UBound(Runner(i)) - 20 To UBound(Runner(i)) x20sum(i) = x20sum(i) + Runner(i)(y) Next y Next i I cant get past '+ Runner(i)(y)' which is a syntax error. Any ideas how to rewrite this. Regards Robert |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Dim Runner(1 To 20, 1 To 4) For y = LBound(Runner, 1) To UBound(Runner, 1) x20sum1 = x20sum1 + Runner1(y, 1) x20sum2 = x20sum2 + Runner2(y, 2) x20sum3 = x20sum3 + Runner3(y, 3) x20sum4 = x20sum4 + Runner4(y, 4) Next y -- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... Hi, Others today have already kindly helped with my queries today, for which Im grateful. I though Id post this to see if it helps with the questions I m asking. Below is my attempt, xsum are normal variables and runner are static. I was looking at this and seeing if I could use a for/next with it, as I wish to add many more runners, and with prev help Ive used Dim xsum(1 to 4) which is ok, but Im struggling with the static variables. For y = UBound(Runner1) - 20 To UBound(Runner1) x20sum1 = x20sum1 + Runner1(y) x20sum2 = x20sum2 + Runner2(y) x20sum3 = x20sum3 + Runner3(y) x20sum4 = x20sum4 + Runner4(y) Next y This is what Ive attempted but doesnt work. I though diefine the runners individually. For i = 1 to 4 For y = UBound(Runner(i)) - 20 To UBound(Runner(i)) x20sum(i) = x20sum(i) + Runner(i)(y) Next y Next i I cant get past '+ Runner(i)(y)' which is a syntax error. Any ideas how to rewrite this. Regards Robert |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob, that great. Ive replyed to my other post. Thanks for taking
the time. Its been a great help today. Regards Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Write to csv | Excel Discussion (Misc queries) | |||
How do I write X^2? | New Users to Excel | |||
How do you write a T with a bar on it? | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
Better way to write this | Excel Programming |