View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Glen[_5_] Glen[_5_] is offline
external usenet poster
 
Posts: 31
Default Simple macros question

Use a for loop if you know how many times you need to iterate.

For i = 1 to 100
Range("C" & i & "").Select
ActiveCell.FormulaR1C1 = "=AVERAGE("A" & i & ":B" & i & "")"
Next


This assumes A(i) and B(i) hold the numbers you want averaged and the
result is placed in C(i)