#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write to csv Jeff Excel Discussion (Misc queries) 0 November 21st 07 07:00 PM
How do I write X^2? webb New Users to Excel 2 October 15th 07 08:21 AM
How do you write a T with a bar on it? sheezyspearean Excel Discussion (Misc queries) 1 September 15th 05 03:43 PM
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? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
Better way to write this Steph[_3_] Excel Programming 2 May 11th 05 11:33 PM


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

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

About Us

"It's about Microsoft Excel"