View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jpballegeer@gmail.com is offline
external usenet poster
 
Posts: 3
Default I want a special Sum function but I need help with that

I made some metacode how it should look like but I need more VBA help

' 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(DAY-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