![]() |
re write
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 |
re write
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 |
re write
Thanks Bob, that great. Ive replyed to my other post. Thanks for taking
the time. Its been a great help today. Regards Robert |
All times are GMT +1. The time now is 05:00 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com