Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default DynamicSum with counters??

I'm really want to find out how to put this metacode in Excell

' CounterDay represents the columnnr where the calculation has to
happen. Starts on row 31 untill row 365
' CounterV is the counter to count the number of V's he finds (it
stops counting when CounterN has reached 30
' CounterN Is Increased by 1 when the cell A(DAY-1-CounterV) is equal
to the Value "V"

CounterDay = 31

IF A(CounterDay-1-CounterV) = V
Then CounterV = CounterV+1
Else CounterN = CounterN+1
End If CounterN = 30

Sum=B(CounterDay-1):B(CounterDay-CounterN)
Put Sum in Cell C CounterDay
CounterDay + 1

End If CounterDay=365

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default DynamicSum with counters??


For i = 31 To 365
If Cells(i,"A").Value = "V" then
CounterN = CounterN + 1
If CounterN = 30 Then
Exit For
End If
End If
Next i

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"zymo" wrote in message
ups.com...
I'm really want to find out how to put this metacode in Excell

' CounterDay represents the columnnr where the calculation has to
happen. Starts on row 31 untill row 365
' CounterV is the counter to count the number of V's he finds (it
stops counting when CounterN has reached 30
' CounterN Is Increased by 1 when the cell A(DAY-1-CounterV) is equal
to the Value "V"

CounterDay = 31

IF A(CounterDay-1-CounterV) = V
Then CounterV = CounterV+1
Else CounterN = CounterN+1
End If CounterN = 30

Sum=B(CounterDay-1):B(CounterDay-CounterN)
Put Sum in Cell C CounterDay
CounterDay + 1

End If CounterDay=365



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
Counters halem2[_78_] Excel Programming 3 June 30th 06 09:59 PM
Counters Paul Excel Worksheet Functions 2 February 11th 05 01:52 PM
Using for next with two counters Albert Jameson Excel Programming 1 October 15th 04 02:37 AM
Counters Terri[_5_] Excel Programming 2 September 27th 04 08:23 PM
counters tag Excel Programming 0 September 14th 03 12:48 AM


All times are GMT +1. The time now is 09:26 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"