View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Matthew Dyer Matthew Dyer is offline
external usenet poster
 
Posts: 178
Default 2 dimensional loop, averageif formula

On Mar 23, 11:31*pm, Javed wrote:
Hope the following will solve the problem

For i = lastrw + 2 To lastrw + 4
* * For ii = lastcol - 37 To lastcol
* * Cells(i, ii).Formula = "=averageif(a1:a" & lastrw & ",b" & i &
",c1:c" & lastcol & ")"
* * Next ii
Next i


Man, I have no idea what you did differently in your formula to make
it work but it works! Had to make one minor tweak though -

Cells(i, ii).Formula = "=averageif(a1:a" & lastrw & ",b" & i & ",c1:c"
& lastRW & ")"

now the only other thing i need help with is getting the C's to
advance with each step of the loop... Thanks for your help Javed!